58,884 questions
0
votes
0
answers
22
views
How to manage DTO proliferation for different API operations
I'm having trouble managing DTOs.
I'm working as follows: I have a reusable DTO called PhoneResponseDTO that is used in both findAll and findByID. Then I created a DTO for each operation like Created, ...
0
votes
0
answers
17
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
72
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
69
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 ...
2
votes
1
answer
83
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
100
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")...
-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:
...
0
votes
1
answer
53
views
spring boot exposing rest over tls vs consuming tls
In a spring boot application, I have to expose apis over tls/https and at the same time, I have to consume other apis that are exposed over tls/https. What is the best way to configure the truststore ...
0
votes
0
answers
68
views
Thymeleaf TemplateInputException when injecting dynamic fragment via ${content} in layout.html (Spring Boot 3.5.6)
I'm using Spring Boot 3.5.6 with Thymeleaf 3.1.3, and I'm trying to implement a dynamic layout system where I inject a fragment into layout.html using a model attribute.
Controller:
@GetMapping("/...
0
votes
0
answers
103
views
I can't find io.modelcontextprotocol.sdk
I have a task to implement a streaming HTTP MCP server in Spring Boot. I injected the dependencies as follows:
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<...
0
votes
0
answers
61
views
Spring Migration - getting NoClassDefFoundError during application bootrun
I am in the process of migrating spring boot to version 3.5.6 (from 2.2.2).
I am getting the following error while running the boot run for the main class
Error: Could not find or load main class com....
1
vote
0
answers
70
views
Why does spring.thymeleaf.enabled break Spring Boot 3.5.0+?
I was testing a different Spring Boot + Thymeleaf example projects using 3.5.5 and the Thymeleaf view seemed to break if the 'spring.thymeleaf.enabled' setting was in application.properties. It didn't ...
0
votes
0
answers
41
views
Does exists a pattern for Spring MVC Framework to handle progressive job?
I have to improve an import job in my web app made with Spring MVC Framework.
This job can take a bit then would be great to give the user the progression and the possibility to interrupt it.
I'm ...
-4
votes
1
answer
58
views
JSL-Springboot security login page redirecting infinitely (ERR_TOO_MANY_REDIRECTS)
/login page seems to be stuck in a loop of being redirected to self.
For context, I want /register & /login to be visible without authentication, while all other pages in my project should ...
2
votes
1
answer
72
views
Set response redirect to 301 status
Right now, I have a web application that returns a redirect response if certain conditions are met. That comes back to the browser as a 302 redirect. I would like it to be a 301 redirect instead.
I ...
0
votes
0
answers
47
views
Springboot Web mapping same controller as 2 beans
I'm generating controller code from openapi3 spec using gradle openapi generator plugin 6.3.0.
Generate, compile works fine, but getting a runtime error:
Caused by: java.lang.IllegalStateException: ...
0
votes
0
answers
63
views
Spring Boot REST API returns 404 on POST
I'm building a REST API with Spring Boot and I have a controller for handling tasks. When I try to send a POST request to /tasks using Postman, I get a 404 Method Not Allowed error.
My goal is to send ...
0
votes
0
answers
76
views
Spring API Gateway configuration for reactive and non-reactive web sockets
I'm working on a WebSocket proxy microservice in Java, built using the org.java_websocket.* library. It connects to a remote server that streams VNC data. The goal is to allow clients—like noVNC—to ...
-2
votes
1
answer
341
views
Can i use spring version 6 and above with Java version 8?
I wanted to upgrade my spring version from 5.3.39 to the 6 series. But when I tried to do that, it didn't compile and threw an error.
This is the error that I'm getting:
Failed to execute goal org....
-1
votes
1
answer
123
views
(Not a) Bug in spring framework forward
I believe I've uncovered a bug in spring framework with the forward: notation. This is happening with XML based spring applications.
I found this while upgrading my existing spring framework ...
2
votes
1
answer
89
views
About spring InterceptorRegistry.addInterceptor() not working
I am currently learning about spring and the concept of beans. I learned that in spring project you can configure in 3 ways -- xml, annotation-based and java-based. I am trying to configure my ...
0
votes
1
answer
75
views
Expired JWT accepted in Spring Boot test
Doesn't Spring check the expiration date of a JWT token, at least in tests?
If so, do I have to do it manually in my code, or is there a way to make Spring do it itself?
<parent>
<...
0
votes
1
answer
102
views
Grouping multiple request parameters as single param for @RestController method
Suppose my Swagger-enabled endpoint receives lots of request parameters. I don't want to list all of them one by one. Instead, I want to group them somehow. Preferably, as a DTO: if I declare a Map, ...
0
votes
1
answer
38
views
Static resource not being hotloaded
I am using tailwindcss version 4 via npx to watch my source files "../jte/**" and rebuild the static resource main.css. However when it is rebuilt, it will occasionally take a long time to ...
0
votes
0
answers
72
views
How to share authenticated user's UserDetails from Spring Cloud Gateway to microservices (via Eureka)?
I'm working on a Spring Cloud microservices architecture using:
Spring Cloud Gateway (running on port 7000)
Eureka Server for service discovery
Microservice A (/datamanager, port 8000)
Microservice B (...