Click here to Skip to main content
15,893,594 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 Title

Spring 

6 Jan 2019 by Member 14110143
The Site is showing the 504 gate way timeout error frequently. Because the CPU utilization was reached maximum. We have used AWS RDS, Hibernate, MySQL, Spring MVC in our application. Unable to find the reason for maximum CPU utilization. Please help me out on this issue. What I have tried: ...
6 Jan 2019 by Richard MacCutchan
This is an impossible question to answer. You need to gather more information from your system. [edit] Reposting the same question is not going to change the answer. [/edit]
6 Jan 2019 by OriginalGriff
When you asked this question an hour ago: Maximum cpu utilization[^] I told you we can't help you. That hasn't changed, even if you wish it had ...
6 Jan 2019 by Patrice T
Reposting same unanswerable question half an hour later will not improve answers. Maximum cpu utilization[^] The host admin is probably the only one able to give you useful hints.
26 Jun 2021 by Aakash V
Customer Registration Form .error { color:red; } Fill out the form.Asterisk(*) means...
15 May 2017 by Florian Lopes
This is a tool for Spring MockMvcRequestBuilder to post form objects.
28 Sep 2016 by Florian Lopes
This post explains how to restrict access to an area, based on active Spring profile.
9 Aug 2021 by Lucius Raleigh
Currently I'm having a problem that I don't know how to solve. It's the decryption and encryption of the string using AES256. Everything was working fine until I restarted the server and I couldn't decode the previous data. Hope everyone can help...
9 Aug 2021 by OriginalGriff
You are using a random number generator to produce your IV when you encrypt your data : unless that exact IV is used when you decrypt it, what you will get is nonsense. So every time your app is closed, the current IV is discarded and when it is...
5 Jan 2015 by sejco1234
"Could not delete C:/..../WEB-INF/lib. May be locked by another process."
5 Jan 2015 by sejco1234
How to solve that problem, because the very big part of the app ain't working now?
18 Feb 2019 by Member 14154379
I'm trying to learn thymeleaf deeper and facing a problem, that after a post method nothing appears in my other page. I've watched tutorials and docs, but seems I`m missing something. So first of all I have main page with MainController: package com.gallery.galleryproject.controller; import...
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).
8 Mar 2024 by Han Bo Sun
This is a more in-depth tutorial on integrating Lucene search and index engine in Java applications.
18 Jan 2021 by Han Bo Sun
Another tutorial on file upload with AngularJS, using FormData for multipart file upload
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.
4 Mar 2015 by Sairam39
I recently established load balancing using apache 2.4 +mod_jk 1.2.37 +tomcat 6 environment.Everything working perfectly but I am having a scenario where a unique sequential no has to generate based on some conditions.But after deploying the application in all 3 (clusters) tomcats, my...
27 Jan 2021 by Member 14639038
i want to export data to excel file from jsp page by using spring mvc application with hibernate bt when i run the application it generates excel file with headers only. I am writing the code : QueryListExcelView.java---------> package...
27 Jan 2021 by Richard MacCutchan
export data from jsp page to excel - Google Search[^]
7 Apr 2024 by Office Systems
'm getting this error java.lang.IllegalStateException: Calling [asyncPostProcess()] is not valid for a request with Async state [ERROR] in an API gateway when I'm executing order-service which uploads more than 700,000 records fetched from an API...
29 Sep 2018 by Member 14001894
Halli Hallo i hope im at the right Place. I want to get started with API-Gateway(s). Currently im running 5 Microservices written in Java (Spring-Boot) deployed via Docker. Each Microservices is protected via Keycloak. I want to use a API-Gateway so that i can combine every MS into 1 Link: ...
1 Oct 2018 by Member 14001894
im using spring therefore i choose zuul ( https://spring.io/guides/gs/routing-and-filtering/ )
19 Apr 2020 by Roland Roos ICT Architectures
Using patterns like aspect-oriented programming in modern OO-languages in micro-services context
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.
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...
21 Dec 2021 by Richard MacCutchan
It is usually best to use the proper Date or DateTime type. Check the documentation for the h2 database at Data Types[^]. But if the experienced guy insists that you use a long type then ask him to explain why.
19 Apr 2019 by PEIYANGXINQU
Now I have two database called db1 and db2,which both have the save process flow diagram.I want to execute the activiti process according according the parameter. For example,if I pass the para which value is 1,I want to execute the activiti process using db1.if I pass the para which value is...
27 Feb 2024 by UT7
Hello everyone, please I can't get SpringMVC project to create a table in MySql database. My entity class is below. @Entity @Table(name="customer") @Data @NoArgsConstructor public class Customer { @Id @GeneratedValue(strategy =...
21 Mar 2024 by UT7
I've resolved this issue, start.spring.io created a package for the main class where the SpringApplication.run method is and I created my other packages on the same level as the package where the main class was instead of creating them directly...
29 Jun 2019 by shreeram09
I have created spring mvc project in which I am using JdbcTemplate mechanism to carryout database operations. I am running a scheduler which 1. parses XML file with 300K records 2. validates each field and stores in a model object 3. after preparing object, search in database with select query...
4 Mar 2022 by Member 15471521
I get this error when I try to execute this query DELETE FROM bookings as b WHERE b.check_out = CURRENT_DATE; Cannot delete or update a parent row: a foreign key constraint fails (online_booking_app.booked_rooms, CONSTRAINT...
14 Jul 2023 by Thang Đai
I am writing a search function from date to date. But when I click search it doesn't return any results and it doesn't give me any error. file handover.html
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...
18 Aug 2015 by OniJava
What should be mentioned in the action property of a form tag in jsp?What should @RequestMapping corresponds to?This is the example i am trying - Home.jsp
29 Nov 2016 by Member 12783584
I am using ui grid for my application. I have to use column filter. I am trying to apply the enableFiltering property to the grid but its not working. Am I missing something?What I have tried:$scope.gridData = [ { name : "Moroni", age : 50, department : 'HR' }, { name...
28 Dec 2022 by Member 10514913
I am seeing a lot of annoying errors when I run spring boot tests java.net.UnknownHostException: telegraf.system at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567) at...
23 Dec 2016 by sandybelieve
org.springframework.beans.fact...
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...
1 Sep 2022 by Richard MacCutchan
Your constructor is: public JobRecruiter(int id, String jobTitle, String recruiterName) So any code that instantiates a JobRecruiter object must pass three parameters. The only lines I can find where it makes such a call are JobRecruiter...
19 May 2016 by Han Bo Sun
This article will give an introduction on how to create microservices using Spring AMQP and RabbitMQ.
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.
18 Oct 2021 by Matthew Casperson
In this article we’ll explore integrating Azure AD and MSAL with a Spring Boot web application.
20 Oct 2021 by Matthew Casperson
In this article, Using MSAL to Access Azure APIs, we use the OBO OAuth flow to call a service in Azure. Then, we’ll communicate the results back to the frontend application via a shared database.
11 Jun 2017 by Arturs Solomencevs
About database transactions and using Spring Framework
26 Apr 2023 by Office Systems
How can I delete large amount of data more than 10 million records in fraction of a second in spring boot project, the code I'm having right now takes more than 1 minute and 30s to delete these records. Below is the code I'm using to delete these...
18 May 2023 by Office Systems
I have deployed angular project in it's own app service and also deployed spring boot in its own app service the two applications works fine locally but the problem comes on production I get this error "Cross-Origin Request Blocked: The Same...
18 Jan 2024 by Pete O'Hanlon
The problem isn't in your code, rather the problem is with your deployment. You have stated that you deployed your application to Azure, and this brings its own set of expectations. Basically, the CORS request is being blocked by Azure, not by...
5 Feb 2016 by Member 12309199
I have below three code snippets all doing the same thing creating in-memory authentication. So how it impacts defining it in different method names?registerGlobalconfigureconfigureGlobalconfigureGlobalSecurityONEpublic void registerGlobal(AuthenticationManagerBuilder auth)...
5 Feb 2016 by Member 12309199
I renamed the method in my sample project to below and to my surprise it working and authenticating the users.@Autowiredpublic void anyMethodName(AuthenticationManagerBuilder auth) throws Exception { ...
27 Oct 2023 by Richard Deeming
Quote: Adding ORDER BY clause gives the similar order and data every time but I do not need that for the requirement. Except you do need that. If you don't specify an explicit order for the results, then the order is undefined. The DBMS is...
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...
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...
28 Oct 2014 by Omar Gameel Salem
Avoid typing view names in Spring controllers by hand
6 Mar 2014 by Member 10624370
Following is my contextConfigLocation file where i have added bean tag to add multipart resolver to my project to upload file, here after adding this i am getting error "HTTP status 404 -type Status report message description The requested resource is not available. "Above error is coming...
30 Mar 2023 by Office Systems
'm Creating a spring batch project and I have tried to create all the key components required for the spring batch to run but I'm getting the exception 'Error creating bean with name 'scopedTarget.patientReader' defined in class path resource'...
6 Feb 2017 by vishal.v.patil
Error spring application.. the project working smoothly but on deployment it will giving below error here i am using java 6 and tomcat 6SEVERE: Exception sending context initialized event to listener instance of class...
6 Feb 2017 by praveenlob7
Hi,Compare your local tomcat server.xml and hosted tomcat server.xml for config changes.
6 Mar 2022 by Member 15471521
I have a profile page and an update page. First time I hit update I get the error messages, second time I hit update with all fields populated I get this error: Completed 405 METHOD_NOT_ALLOWED "ERROR" dispatch for POST "/error",...
23 Sep 2018 by Member 13994629
Error: Could not find or load main class com.raj.spring.springormagain.Test What I have tried: Test.java package com.raj.spring.springormagain; public class Test { public static void main(String[] args) { System.out.println("hello world"); } } POM.xml
31 May 2014 by Member 10856945
I have to get the facebook user profile , and his friends list using spring social facebook api in web application
31 May 2014 by Abhinav S
TrySpring Social Facebook 1.0.3.RELEASE API [^]Facebook API Binding[^]
16 Apr 2018 by Member 13783074
I have a table with columns as rows. Now I want to apply restriction on multiple rows with "and" condition.how can we do this using hibernate criteria? Example :Employee table Pk ColumnName. Value 1. Empid. 10 1 EmpName. Sachin 1. Empsalary. ...
16 Apr 2018 by Wendelius
You can use Restrictions (Hibernate API Documentation)[^] calling And method to define multiple conditions having AND.
4 Jul 2023 by Office Systems
I'm trying to fetch data using Spring Boot for my REST API from PostgreSQL Database, I have more than 30 million records in my database, the API takes a lot of time to pull data from the database and sometimes it results on time out error when...
4 Jul 2023 by Richard Deeming
Quote: I just want to count the results I can't return such data to the user there is no means I can count these values depending on these conditions provided Your code is loading all 4 million matching records into a list, simply to return...
3 Feb 2015 by stitchypoohpika
I stored multipartfile to session and I retrieved it to display in table. when I click on this file, I got the error as follow,This is my coding in controller. If I upload 12KB size pdf file,it has no error. but when I upload 14KB size file, it shows error LikeFIle has been moved - cannot be...
25 Jan 2016 by RaydenFox
I have successfully installed spring tool suite n eclipse jee and now setting up the Pivotal tc server but I can't locate the installation directory of the Pivotal tc server in eclipse. Please help...
29 Aug 2021 by SHYKAT ROY
Basically, I am trying to establish a relationship between my two tables using spring boots. And the relationship which I had used was the @onetoone and @onetomany relationship. But after building the relationship and creating the table in MySQL...
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...
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?
23 Aug 2012 by Keyhole Software
This is part 2 of how to get started with Spring Batch
2 Dec 2019 by RickZeeland
Maybe this article will be helpful: Designing REST APIs | Vaadin[^] And also: Consuming REST services from Java applications[^]
19 Apr 2016 by Virat Panday
Hi i'm learning spring framework and planning to do a small project. the below link seems very useful but being a beginner, i cannot understand. Can anyone explain the project from the below link?https://github.com/jackcrews/ProgrammingProblem.gitWhat I have tried:I know Java and...
19 Apr 2016 by leon de boer
In pseudo code it's reasonably simple, you have two parts a client and a serviceThe service expects the client to call validate with a password(s).The service then checks the password(s) for a number of things - checkLength .......... must contain 5-12 characters - checkCase ...
4 Jan 2016 by Han Bo Sun
Detailed description of how many-to-many association works with Hibernate, using MySQL and Spring
7 Dec 2021 by Member 15435322
I was wondering, what is the best way to create relationships between entities in a project that is being written from scratch, or specify what relationships to have between them? For example, as we can directly understand the relationship...
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,...
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.
20 Oct 2021 by User 15041314
{ "message": "The operation was successful.", "code": 200, "fileDetailResponseDtos": [ { "phoneNumber": "550000000", "textMessage": "Message1", "createDateTime": "2021-10-20T15:45:27.277", "sender": "Anar", ...
7 Mar 2016 by Member 12375828
Hi all,I have a spring mvc application,there are two steps that I want to do.First to read date from database and show it in a table in jsp file,for each row in the table,there is a drop down list in the jsp file.Next step is to submit the data in the table,but the problem is that...
7 Mar 2016 by Shubhashish_Mandal
Hope this link will give your all answer.W2Ui GridI have used it in many application. It is really a cool api.
6 Dec 2021 by Member 15435322
Suppose I am returning data like this in rest api: { name:"Ronald", age:25, salary:1500 } But what should I use to design variable names as I want? For example: { Name: "Ronald", Age:25, Salary:1500 } How can I design that only variable...
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,...
21 Jan 2015 by stitchypoohpika
I inserted first record without error. After first record, I faced the error as follow."Cannot add or update a child row: a foreign key constraint fails (`cims`.`hra_prm_claim_common`, CONSTRAINT `hra_prm_claim_common_applicationId` FOREIGN KEY (`applicationId`) REFERENCES...
21 Jan 2015 by Wendelius
Based on the error the record you're trying to add to table hra_prm_claim_common has a value in applicationId field that does not exist in hra_prm_claim_application table in applicationId field at the time of insertion.Few things to check:- are you doing things in the right order, first...
10 Mar 2024 by Office Systems
I have two arrays which both have data, what I want to do is to loop through each array and compare the data between the arrays one array is coming from the Post Method and another array has data from the database, so the comparison has to be...
10 Mar 2024 by Pete O'Hanlon
As I don't know what Order looks like, I'm going to make some assumptions in this answer. The big assumption I'm going to make is that you have an Integer id value in the class, which I can get using getId();. I'm also going to assume that the...
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....
26 Jun 2016 by Member 12605086
I have two dropdown list, both are filled with 30mins intervals eg:9:00AM ,9:30AM...etc to 5:30PM how can i validate this with the following condition...1)From time must be less than To time.(time format 12hrs with AM & PM)2)If a program is scheduled for 10:00AM to 11:00AM, then another...
26 Jun 2016 by Richard MacCutchan
You should use a Date (Java Platform SE 7 )[^] object, which provides methods for comparing different values.
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; ...
11 Mar 2017 by Tosby Odhiambo Joséph
Hi would someone please help me add javascript, css images and other static files to my jsp pages. I have tried severally and defeatedWhat I have tried:I have tried adding js by adding this line to my jsp file to...
11 Mar 2017 by Tosby Odhiambo Joséph
I have tried to solve it but there are some issues especially with the javascript which is not working despite being loaded, I have therefore settled on having it within the jsp file. Here is my code for the jsp file
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...
11 Feb 2017 by Richard MacCutchan
What exactly did you search for? See create rest spring mvc - Google Search[^].
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...
15 May 2018 by Member 13828418
Hello everyone I'm trying to download files from an sftp server and i didn't know how to make it work I'll show you my code and tell where did i go wrong :) What I have tried: I tried it with the code below and when i test it with postman i got 404 not found as a response : maybe it means...
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 Jun 2021 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...