title: Can Spring MVC catch an exception and return a BindingResult in the response for all controllers?
body: <p>I am trying to leverage an existing validation framework on the service layer of my application that throws a ValidationException in the event of validation failures. This exception object holds multiple errors, and I want to utilize an exception handler in Spring MVC to extract those errors and return validation messages to the view (thymeleaf).</p>
  
  <p>So I have two questions about how to do this:</p>
  
  <p>1) Can I manually create the BindingResult object out of a list of custom error objects to pass to the view layer?</p>
  
  <p>2) Can I catch a ValidationException from a handler in a base Controller (could be thrown from multiple methods) and have it intercept the response and return the view with the validation messages? Or do I have to try/catch this exception in every controller method where it could be thrown and pull out the binding result there?</p>
  
  <p>Obviously it would be better if all of this happened in one spot- if one handler can catch a ValidationException and inject error messages into the view. But would that method have access to the returned model and view? Any advice on this architecture would be very helpful.</p>