1,615 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
60
views
Spring Boot @Valid returns just "Bad Request" message instead of my custom message
I just want to get my custom message in Swagger response (not just "Bad Request")
@RestController
@RequestMapping
@RequiredArgsConstructor
public class GenUrlController {
private final ...
0
votes
1
answer
133
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")...
1
vote
0
answers
77
views
Do not load parent controller if child controller exists
I use Spring Boot 3.3.4 and Java 21.
I have several Spring Boot web application that use the same common library :
App1
App2
App3
Common
In this common library, I have a @RestController used to ...
1
vote
1
answer
68
views
Spring boot 3.4.7 @Valid validation allows empty json on a PUT/PATCH rest endpoint
With the use spring boot 3.4.7 noticing a below change
We have a pojo with lomobok annoatiaon
import org.springframework.validation.annotation.Validated;
@Builder
@Validated
public record AppState(
...
0
votes
1
answer
70
views
Binder.getTarget() is null, can not binding custom key, value using initBinder in Spring 6.x
I am having trouble binding custom key and value map after migrating to 6.x where binder.getTarget() comes out to be null. I debugged and it turnes out binder target is set later point of time. Is ...
2
votes
0
answers
41
views
Spring Boot REST endpoint seems to not execute Neo4j Java driver statements (JHipster + Neo4jConfig + Neo4jService) → no Cypher run
I am integrating Neo4j into my JHipster 8.5.0 / Spring Boot 3.3.0 application.
I have configured a Neo4jConfig with a Driver bean, a Neo4jService to send Cypher statements, and a REST endpoint /api/...
0
votes
0
answers
78
views
How does spring-boot 3.5.0 evaluate which java.time.format.ResolverStyle to be used depending on the local?
I have a Restcontroller with a parameter with a LocalDate like this:
@RequestParam @Schema(requiredMode = REQUIRED) @NonNull final LocalDate startDate
When calling the endpoint with a Swedish ...
0
votes
1
answer
47
views
Form URL encoded data and Spring Rest Controller, data coming as null
We are getting a request from 3rd part and in our logs the body is printed like this
"body":"Response=%7B%22TransactionType%22%3A1%2C%22Approved%22%3Afalse%2C%22TransactionIdentifier%22%...
1
vote
0
answers
23
views
Testing RestController class with HATEOAS links
I am working through the Amazon Junior Dev Certificate on Coursera and finishing up the course on Spring Boot APIs. The current lab I am working on is requiring me to write unit tests for a ...
0
votes
1
answer
163
views
How to fix this: Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' is not supported
I have a Spring Boot REST API, and it works perfectly when tested via Postman—all HTTP methods function as expected. However, when I try to interact with the API from the client-side application, I ...
0
votes
0
answers
79
views
Having more control over "@RequestBody Entity entity" when creating/updating a record
I am switching to Java/Spring from another development stack and I am very confused about how in Spring some things are done.
One of the issues is the magical conversion of request body parameters ...
0
votes
2
answers
52
views
Spring restcontroller with RequestParam String conflcting in controller
I have a Restcontroller with 4 methods, but I can't use the calls, I always get the error: "message": "No static resource api/corp.",
I need method with string like:
localhost:...
1
vote
2
answers
265
views
How to perform redirect in HTMX based on response from the Spring boot JSON rest API?
I am checking examples of Htmx + Spring. All examples use server-side template engines ( like Thymeleaf or Jte).
Htmx expects an HTML response from Spring, but Nowadays, most Spring applications ...
0
votes
1
answer
446
views
Content-Length header is removed from HEAD response
We have a REST controller with a HEAD method but no GET method. We don't want the client to be able to retrieve the resource, but we do want them to be able to know whether it exists and how big it is....
1
vote
3
answers
113
views
Spring Boot Controller Not Registering and 404 Error on POST Request
I’m working on a Spring Boot application, and I’m having trouble getting my controller to register correctly. When I try to POST data to the /student/add endpoint, I receive a 404 error, indicating ...