Snippets tagged “response-status-exception”
1 snippet uses this tag.
- How to respond with an HTTP 400 error in a Spring MVC @ResponseBody method returning StringJava
To respond with an HTTP 400 error in a Spring MVC controller method that returns a String, you can throw a ResponseStatusException with a status of BAD_REQUEST.