Click here to Skip to main content
15,884,928 members
Everything / Web Development / Spring

Spring

Spring

Great Reads

by vladimir husnullin
Web development using JSON is simple
by vladimir husnullin
Web development using JSON is simple
by Han Bo Sun
In this tutorial, I will introduce the use of Spring JdbcTemplate in a Spring Boot web application. This tutorial will show how to create the necessary configuration for JdbcTemplate. And how it can be used for data insertion and retrieval.
by Grzegorz @ tidyjava.com
List of practices to work effectively on Spring applications. This part focuses on starting a new Spring project.

Latest Articles

by Han Bo Sun
This is a more in-depth tutorial on integrating Lucene search and index engine in Java applications.
by Han Bo Sun
In this tutorial, I will discuss how to add file upload functionality to an Angular web application.
by Han Bo Sun
Loading data in batches and displaying using UI-Grid in an AngularJS based app
by Han Bo Sun
This tutorial will discuss how to configure CORS for Spring Boot web application.

All Articles

Sort by Updated

Spring 

26 Jun 2021 by Aakash V
Customer Registration Form .error { color:red; } Fill out the form.Asterisk(*) means...
8 Feb 2020 by aayush kc
I am using spring security with thymleaf in my project. I want to use thymleaf security tag in my project.I have added some of the dependency in my project but it is not working In my pom.xml org.springframework.boot ...
31 May 2014 by Abhinav S
TrySpring Social Facebook 1.0.3.RELEASE API [^]Facebook API Binding[^]
30 Jun 2014 by Abhinav S
Use a stored procedure.Send data using parameters and then insert both the queries.
20 Mar 2016 by Afzaal Ahmad Zeeshan
ASP.NET is written and runs on the top of .NET framework, whereas Spring framework runs on a Java framework; Java EE. Converting one to another is not possible, because there may be many differences in the frameworks. Even if you can find a tool to convert one to another, you are going to fix...
7 Dec 2021 by Afzaal Ahmad Zeeshan
Quote: create relationships between entities in a project that is being written from scratch, or specify what relationships to have between them? That's the best part about an ORM. You don't need to think about it yourself (apart from some index,...
29 Jan 2021 by Akash Tawade
I trying to fetch data from spring boot controller but the data not appeared in front side ReactJS. Spring boot controller working fine in localhost and data also appeared in localhost. Spring Boot Controller: package...
29 Jan 2021 by Akash Tawade
I got my mistake. Solution: we need to enable CORS from server side so that we can fetch data from front side. To Enable this we need to add one function in server side application. I'm using spring boot so, you need to add this function in...
18 Apr 2016 by akashraveendran
I am using com.fasterxml.jackson.core:jackson-annotations:2.7.3 in my gradle project. Since adding com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.7.3 to my project build file I have been getting this exception while running my gradle project. Here is the stack trace of my error. ...
21 Dec 2021 by Alex Darius
I am new to spring boot, working on a project, and recently an experienced developer just told me that when creating an entity table, that has a field that should deal with dates the best approach is to use long, something like this: private...
6 Jul 2017 by Amr Mohammad Rashad
I need to learn about spring framework and I advised that I should learn Java language in the first place in order to be able to learn spring framework and my question is to what extent I need to know about Java language. I meant is it suffice to know about basics (Syntax, Inheritance,...
16 Jan 2023 by Andre Oosthuizen
You are adding a new client twice, at the start of your code and then again within another if else statement. I am not familiar with the code used ?-Java/MongoDb -? but the basics is the same How it works - 1. Search data table for client with...
14 Jul 2023 by Andre Oosthuizen
There are a few issues you can check that might cause a no return on your date request. I have added comments in your code where you can check. I have also added the 'System.out.println' to debug all returned parameters in your controller, check...
23 Aug 2023 by Andre Oosthuizen
The error relates to your view resolver configuration that is causing a loop in dispatching requests. Without seeing the complete configuration of your Spring Boot application and the context in which this controller is being used, it's a bit...
21 Mar 2024 by Andre Oosthuizen
Your issue is in the way you are invoking the async 'process_data' method in the 'OrderProcessingService' class. The method is being executed in a separate thread, however, the problem is that your 'process_data' method is not returning anything,...
1 Aug 2021 by Andre Ridho
I am trying to learn SpringBoot and Thymeleaf and I am getting a PropertyReferenceException. Most of the answers online have to do with naming errors, yet I have no naming errors; everything is in perfect camel case. Any ideas? Relevant Code: ...
26 Feb 2014 by Anil kumar Tripathi
how to manage date and time between different time zones in spring +Jquery
16 Oct 2014 by AnvilRanger
If you are looking for an open source solution to handle searching needs locally to your site you should checkout Lucene[^]. It requires some setup and a little programming, but it would be what you are needing.
12 Oct 2022 by Arli Chokoev (Choke)
I need to store some state, I receive in the processor, for each of the StepExecutions separately. For this purpose I created a step-scoped bean, which I try to inject: @Slf4j @Configuration @EnableScheduling @EnableBatchProcessing...
11 Jun 2017 by Arturs Solomencevs
About database transactions and using Spring Framework
16 Oct 2014 by AshishPatha
I have a website which shows the pages dynamically from Database. How should i implement the search engine with the data in database and how should i give the page urls based on the search.I just need the any open source library or how does this works. I will implement based on it.
3 Nov 2014 by Ashraff Ali Wahab
We have a use case where the user can submit 1000 payment transactions(of course in corporate banking this is possible) from a UI.We all know it is impossible to submit all 1000 from the UI all at once. So we have a pagination logic built in the UI where user can save 200 at once. After...
29 Oct 2017 by Asyraf Patt
Sorry ,im new in java. Currently i developing the tools to send the email, but the data such as (to, from, subject, message) i put it as xml file, where i can change it anytime. the question is how i need to send the data from xml to java variable ? in c#: i can do like this, where i can link...
30 Oct 2017 by Asyraf Patt
sorry, im new in java. The question is, how do i need to get the data from xml and use it as my username, password, body message, subject in email ? i already look at java Xml parse but still dont have an idea how to solve my problem. the variable string such as : string from, string to, string...
1 Sep 2022 by Auto Samachar
Could not locate appropriate constructor on class : com.recruit.api.model.JobRecruiter; nested exception is java.lang.IllegalArgumentException: Could not locate appropriate constructor on class : com.recruit.api.model.JobRecruiter/500 I added...
21 Sep 2022 by Auto Samachar
I have vmscontactemail field in the database and models, when I debug the code it shows the above error when I execute that line at managerdetailsrepository.save What I have tried: DAO @Modifying @Transactional @Query("UPDATE...
8 Sep 2014 by basker A
hibernate propertieshibernate.dialect=org.hibernate.dialect.MySQLDialecthibernate.show_sql=truehibernate.hbm2ddl.auto=create-update ** i use these keyword seperately also //create or//update****xml configuration** ...
23 Jan 2015 by beginerbuddy
Hi,I am using displaytag in my project for displaying data in table and I have done pagination and export in that, but when I am clicking on Next/Last/PageNo. [1/2....] and export CSV,pdf,xml,Excel getting Page Not found 404 errorand in my logs, its shows following:-2015-01-23...
27 Jan 2015 by BorusMartin
I have to create a calender with events which may be given by admin. user can select particular date with events to give request and i have used springmvc. Thanks in advance to you...
7 Nov 2021 by Brian Antao
I am in the process of developing a Spring Cloud based API Gateway. This Gateway acts like a proxy that filters multiple JSON API requests/responses The gateway has multiple routes that are defined for each JSON API. I have found a way to define...
17 May 2015 by Bùi Long Nghĩa
Database:table:-books (bookId, bookName, author, publisher, publishingYear, price, quantity, CateId, bookClassId)-bookclass (bookClassId, bookclassName)-categories (cateId, cateName)Spring - Controller @Controllerpublic class ControllerBook { IBookDaoImpl book; ...
4 Jan 2020 by Christian Graus
The id of the user should go against the question or answer, that seems obvious. If you need data across many tables to display this, create views
16 Apr 2015 by CodeZero2
I'm working in a web application using spring mvc 4 (version: 4.0.9.RELEASE) and spring security 3 (version: 3.2.5.RELEASE), my problem is that i can't restrict access to specific view (.html page) inside a folder. I have three (3) modules in my web application: Roles, Permissions, Users....
27 Mar 2023 by Cris29M
How can I fix: The dependencies of some of the beans in the application context form a cycle: registrationController defined in file...
3 May 2019 by Dasitha sandaruwan
I want to call below calculation() simultaneously in calculateKalmanValues() for each element in the 'movingBeacons' list to reduce the processing time. I think java stream.parallel() is the ideal solution. public void calculation(){ // do some think } // This is the method...
29 May 2015 by DatPrettyUrkel
Hey, I'm trying to trigger a JavaScript function with a button, but it doesn't work.The only error I managed to figure out from the Chrome JavaScript console is this one :Uncaught SyntaxError: missing ) after argument list vacAdmin:204It also seems that the function doesn't get...
13 Mar 2023 by Dave Kreskowiak
Think about your query. What does ".is(2)" mean? Is it the month number? The day of the month? How about the yes? Maybe the hour, minutes, or seconds? How is your code telling the database that the 2 is a month? Hint: It's not.
21 Mar 2023 by Dave Kreskowiak
It takes forever because you're looking for a couple of strings, "Disabled" and "Opted Out", probably without any indexing on the field. This is probably the worst way to get the status in terms of performance. If you were looking for integer...
9 Mar 2014 by Davinder Singla
This tip is for solving out of memory issue for large result sets in MyBatis
2 Mar 2022 by Dev Learning
I would like to develop an web application with Spring Mvc, hibernate and Mysql. I know there are many Component libraries that facilitate the development of web applications like Primeng for Angular, Telerik and Infragistics for Asp.Net MVC. ...
5 Oct 2021 by Devin Clark 2021
So let's say you have a UUID in an .xml file in your program and you're writing a java program in a, well, java file. They're both in the same folder so they are in the "same house just different rooms" if you understand what I mean. What steps...
21 Jan 2022 by Dwaipayan Goswami
I'm using Redis in my Spring Boot REST application to store cache. But the problem I'm facing is once it is stored in Redis my API only hits the Redis, not the database. I've added a time out property, but it didn't work. I've tried CacheManager...
29 May 2022 by eboi mela
I could login via LDAP but I cant fetch user role which is stored in my Database. I do get the following error: org.springframework.security.ldap.userdetails.LdapUserDetailsImpl cannot be cast to com.test.rnd.geo.web.dto.CustomUser What I have...
28 Sep 2016 by Florian Lopes
This post explains how to restrict access to an area, based on active Spring profile.
15 May 2017 by Florian Lopes
This is a tool for Spring MockMvcRequestBuilder to post form objects.
19 Sep 2017 by Francisco Duarte DEV
I guys, I'm working on a simple Spring Java application. Sometimes (randomly) I republish to the server but when I run it on the server the changes weren't made. Can you help me? I've turned off the autodeploy. I'm using Spring Tool Suit with Tomcat 8.5. Thank you guys EDIT: Turns out that...
19 Sep 2017 by Francisco Duarte DEV
Tomcat is deploying but browser is opening the cached page. Just refresh the page and changes are made. I'm working with thymeleaf. If you wan't to make it permanent use the following code on your xml config:
4 Sep 2021 by Freeex
I stuck since a couple of hours on a test method. I tried to reproduce a similar example. I have a service who extend a abstract service with an utility method like this: public class MyService extends MyAbstractService { @Autowired...
19 May 2019 by Gerry Schmitz
Considering your trivial data requirements, just create a CSV file and open it in Excel. Once your requirements evolve, you can consider more "complicated" options. 1, "Amit", "Shukla" 2, "Lokesh", "Gupta" 3, "John", "Adwards" 4, "Brian", "Schultz"
23 May 2019 by Gerry Schmitz
public boolean createFolder(String path) { return true; }
6 Dec 2021 by Gerry Schmitz
Quote: The schema helps in a multiple way. It acts as a contract between two teams, serves as a specification, simple to read and easy to follow and you can use it for validation once your APIs are ready. JSON Schema - as a specification,...
26 Oct 2023 by Gerry Schmitz
Add a "timestamp" to the Access records; and use a new timestamp when you update and insert. You can't "delete" initially; you'll need to add a "delete" flag (and timestamp) so you can export "deleted" records; and purge / archive them later. You...
31 Mar 2016 by Grzegorz @ tidyjava.com
Are you using frameworks the right way? Are you using frameworks for business purposes or the other way around? Are your business classes dependent on frameworks?
25 Apr 2016 by Grzegorz @ tidyjava.com
List of practices to work effectively on Spring applications. This part focuses on starting a new Spring project.
28 Apr 2016 by Grzegorz @ tidyjava.com
List of practices to work effectively on Spring applications. This part focuses on effective handling of configuration properties.
14 May 2016 by Grzegorz @ tidyjava.com
List of practices to work effectively on Spring applications. This part focuses on services.
17 Oct 2014 by Han Bo Sun
In this article, I will show you how to integrate Hibernate Search into a simple yet feature complete web application with the Spring MVC and Hibernate enabled.
4 Jan 2016 by Han Bo Sun
Detailed description of how many-to-many association works with Hibernate, using MySQL and Spring
19 May 2016 by Han Bo Sun
This article will give an introduction on how to create microservices using Spring AMQP and RabbitMQ.
14 Mar 2018 by Han Bo Sun
In this article, I will present a fully working Spring MVC application. It integrates with Spring Security, and Spring Rest. The sample application can be used as a template while the tutorial gives you a general idea of how each component work.
17 Oct 2018 by Han Bo Sun
In this article, I like to discuss the way to set up a Spring Boot application that is packaged as a WAR archive and supports Spring MVC with JSP as view.
2 Nov 2018 by Han Bo Sun
In this article, I will show the reader how to secure a web application based on Spring Boot and WAR archive, using the Spring Security and Tags. The application will have a login page, page access based on user roles, login failure, and access denied pages.
20 Nov 2018 by Han Bo Sun
Set up a RESTFul service using Spring Boot and use Spring Security to secure the RESTFul API
3 Dec 2018 by Han Bo Sun
In this tutorial, I will introduce the use of Spring JdbcTemplate in a Spring Boot web application. This tutorial will show how to create the necessary configuration for JdbcTemplate. And how it can be used for data insertion and retrieval.
13 Feb 2019 by Han Bo Sun
In this tutorial, I am going to show the readers how to create an MVC application using Spring Boot, packaging as a self host WAR file, and execute using embedded Jetty application server.
15 May 2019 by Han Bo Sun
In this tutorial, I am going to discuss how ngResource works. I will demo all 4 HTTP verbs (or methods), and multiple ways request input data can be packaged. It will be a very fun tutorial.
3 Aug 2019 by Han Bo Sun
In this tutorial, I will be discussing the approach of uploading files using ngResource with AngularJS.
22 Oct 2019 by Han Bo Sun
This tutorial discusses the way to setup a Spring boot application that can utilize JSTL template and taglib.
18 Jan 2021 by Han Bo Sun
Another tutorial on file upload with AngularJS, using FormData for multipart file upload
16 Feb 2021 by Han Bo Sun
A tutorial on how to setup an application Spring Security and Spring MVC, and use ThymeLeaf for secured page rendering.
22 Jun 2021 by Han Bo Sun
In this tutorial, I will discuss how to handle secured session timeout in an AngularJS application.
21 Dec 2021 by Han Bo Sun
How to use JWT Token with Spring Security for user authentication and authorization
15 Feb 2022 by Han Bo Sun
Tutorial to discuss the design of a moveable popup modal using AngularJS and ui-bootstrap
14 Feb 2023 by Han Bo Sun
Loading data in batches and displaying using UI-Grid in an AngularJS based app
15 Aug 2023 by Han Bo Sun
In this tutorial, I will discuss how to add file upload functionality to an Angular web application.
21 Oct 2022 by Han Bo Sun
This tutorial will discuss how to configure CORS for Spring Boot web application.
29 Apr 2021 by Han Bo Sun
This tutorial will discuss an advanced configuration to use MySQL database as the session management.
8 Mar 2024 by Han Bo Sun
This is a more in-depth tutorial on integrating Lucene search and index engine in Java applications.
9 Jul 2021 by Htc Saj
I start on project with maven and spring boot.On every annotation there is red line below.I didn't import files outside neither I use spring initializer. How to fix this. import org.springframework.boot.SpringApplication; import...
16 Apr 2020 by ILRR
I have a web app built using Spring boot and thymeleaf. I have used only the index page so far which has different models in it and it work just fine. Now I want to add a new page. By new page I mean in the url it says...
9 Jun 2021 by Ishmeet Kaur
When I'm trying to create a new maven project src/main/resources folder is not created in the spring tool suite? What I have tried: I tried to go to properties then build a path but was just able to get src/main/java src/main/resources still...
19 Aug 2023 by jaikrishna310
I am trying to make a project in spring-boot! But in the controller, I am getting an error in the save() method as follows: The method save(S) in the type CrudRepository is not applicable for the arguments...
25 Mar 2019 by James A. Brannan
In this tutorial, we secure a simple Rest API. We begin with a simple example, progress to using a custom UserDetailsService, and finish by adding method level security.
25 Mar 2019 by James A. Brannan
In this tutorial, we create a simple Rest application using POST.
8 Apr 2019 by James A. Brannan
Spring Boot 2 – REST Exceptions
20 May 2019 by James A. Brannan
How to use AWS Java 2 API to create a Rest application using Spring Boot that reads and writes to a DynamoDB database
26 Mar 2019 by James A. Brannan
Spring Rest Using Spring Boot
21 Apr 2019 by James A. Brannan
In this tutorial, we explore creating, reading, updating, listing, and deleting objects and buckets stored in S3 storage using the AWS Java SDK 2.0 to access Amazon’s Simple Storage Service (S3).
13 Aug 2015 by JavaDeep
I've a list of values to be passed from my controller to the jsp page. I've the below controller:@RequestMapping(value="/addClient.do", method = RequestMethod.GET)protected ModelAndView Submit(HttpServletRequest request, HttpServletResponse response) throws Exception { MyForm = new...
7 Jul 2022 by Jennifer Reif
In this article we build a Java microservice that connects to, and interacts with, graph data in a Neo4j AuraDB Free database.
11 Feb 2017 by Jignesh Khatri
I am new to Spring MVC architecture and want to create backend, which interacts with database and which I can access it from website and android app. Following is my understanding till now for Spring MVC -* Model (getter-setter classes)* Service (classes containing CRUD methods for all...
30 Jun 2014 by john_meee
I have 2 tables:public class User implements Serializable { private static final int MIN_SIZE = 3; private static final int MAX_SIZE = 50; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @NotEmpty @Column(name = "first_name", nullable =...
30 Jun 2014 by john_meee
I don't know how to write this ..I tried different queries but no one worked.
1 Feb 2015 by joseacl79
This tip is about the spring security and how to create a custom JSP page to login with.
8 Sep 2022 by Juniorfstack
0 I'm a junior dev and my current project is in spring but unlike JavaScript I cant access the dom.How would I add something to a image so when I click it I can save its name or when I click a submit button that it will be saved. I have been...
27 Oct 2023 by Kanchana Gallage
I am doing implementation for this type of SELECT query in a Spring boot application using named parameter jdbc template. Database used is postgres. SELECT lp.*, gp.NAME, gp.description, FROM global_products gp...
27 Oct 2016 by Karmesh_Madhavi
i am making SPA using AngularJS in Spring 4 with Hibernate 5. i can't able to send request from AngularJS controller to Spring Controller.execution coming inside submit() function successfully, but it's going fail.error shows in browser console:angular.js:12011 POST...
19 Dec 2014 by KARSHAN KHODBHAYA
function departmentselected() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status ==...
23 Aug 2012 by Keyhole Software
This is part 2 of how to get started with Spring Batch