How-to articles, tricks, and solutions about HTTP-ERROR
How to respond with an HTTP 400 error in a Spring MVC @ResponseBody method returning String
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.