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.