All Questions
Tagged with spring-mvc-initbinders or spring-mvc
58,886 questions
0 votes
0 answers
21 views
Spring throws UnknownContentTypeException for empty json object property
I'm working with 2 component with Spring MVC that shares a REST API protocol. The server gives this answer: { "id":1, "alerts": {} } Both shares the same class to map this ...
0 votes
0 answers
31 views
java.lang.IllegalStateException: getAttribute: Session already invalidated when calling API locally
I am getting the following exception when I hit my API on my local server: java.lang.IllegalStateException: getAttribute: Session already invalidated [INFO ] 2025-11-24 17:32:55.729 [http-nio-8080-...
1 vote
1 answer
39 views
@RestController in existing spring-mvc servlet in Spring Framework 4.3
I am maintaining a Spring 4.3 MVC app, upgrading it is a complicated and long term task. For my setup, XML-based, I did not find much on the internet, mostly Spring Boot stuff. I tried adding a @...
1 vote
0 answers
54 views
Spring: How to redirect back to the form after authenticating its POST request?
I have got a (Thymeleaf) form which I have made accessible to all users, even to those who are not logged in, in order to improve the UX. Only submitting the form (through a POST request) requires ...
0 votes
0 answers
21 views
How can I use a custom Date deserializer for Json RequestBody?
I'm using Spring MVC and I would like to control the deserialization of Date objects in RequestBody. I saw I can set a custom JsonDeserializer in the input object, but I would like to set a global ...
2 votes
1 answer
46 views
Can a Spring Framework 7.x WAR run on a Jakarta EE 10 server?
I’m working on a web application which is packaged as a WAR that I’m planning to upgrade to Spring Framework 7.x. I noticed that Spring 7 requires Jakarta EE 11, but the environment I need to deploy ...
2 votes
1 answer
79 views
Login infinitely retrying with bad credentials
I am using Java Spring boot and Thymeleaf. When trying to login with bad credentials, the page freezes for a few minutes, and it says the page isn't working. When I activate debug in application....
1 vote
1 answer
54 views
RequestDispatcher forward(request,response) works in Tomcat 10 but not in Tomcat 11
I'm in the process of doing a technology upgrade for a Spring mvc app. I'm currently using Java 21, Spring 6, and Thymeleaf 3. I've tested the application thoroughly, running it on Tomcat 10. The app ...
1 vote
1 answer
78 views
Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Since more than one mappable servlet in your servlet context:
I am applying Spring Security in a Spring MVC (Spring Boot) application. The application already has CSRF and Session Management and I want to apply JWT Authentication along with Spring security. But ...
Best practices
1 vote
1 replies
61 views
spring UriComponents tobuilder to UriComponentsBuilder
It seems Spring has two classes to represent URLs efficiently, UriComponentsBuilder and UriComponents. UriComponentsBuilder builder = UriComponentsBuilder.fromUriString("https://stackoverflow.com&...
2 votes
1 answer
92 views
Spring-Web OOM when streaming after update from 6.0.23 to version 6.1.4 and above
We have an application where we are streaming files from the filesystem and are PUTting them to an endpoint. This worked fine up to spring-web version 6.0.23. After updating to version 6.1.4, we ...
0 votes
1 answer
55 views
Spring MVC Json decoder to accept both string and long millis values
Is there any way to make Spring decodes both string (es. yyyy-mm-dd HH:MM:ss) and long (unixtime milliseconds) for Date objects?
0 votes
1 answer
107 views
Spring Boot 3.x — @RestControllerAdvice not catching custom exceptions
I recently upgraded to Spring Boot 3.5 (Jakarta packages) and noticed my global exception handler isn’t being triggered. @RestController public class UserController { @GetMapping("/test")...
0 votes
1 answer
85 views
Spring Boot: Redirecting URLs ending in slash to without slash
I want to redirect all routes like /api/user/home/ to /api/user/home. Here is the configuration file for gateway: spring: application: name: gateway cloud: gateway: routes: -...
-3 votes
1 answer
105 views
Why does my /ping route return 404 in a Spring MVC app (not Spring Boot)?
I'm working on my first Spring MVC project (not Spring Boot), and I’m running into a 404 issue when calling the /ping route for a health check. I have a simple PingController defined like this: ...