Is there a way for my @ExceptionHandler methods @ExceptionHandler have access to the model attributes populated by the @RequestMapping method that caused the exception in question?
Or, more specifically, for my problem: my models passed to my views have some data populated with @ModelAttribute methods (for example, detailed information about the user account), and I would like to have them installed in my @ExceptionHandler .
For example, since my error view page uses the same title and menu as my other pages, I want to display the current username (and other information, such as the number of unread messages, etc.).
I know that @ExceptionHandler exists outside of @Transaction (as it should be!), So I obviously can't just (and don't want to) run some queries again. Rather, I would like to pre-populate ModelMap or ModelAndView or something else, and make sure the exception handler handles this β or at least the model data becomes available when rendering the view.
I hope this question makes sense, I'm pretty new to Spring MVC, so I can mix a few concepts here and there ...
source share