Pages

Refactor similar Spring MVC ExceptionHandlers

Monday, May 5, 2014

I have below exception handlers repeated in couple Spring MVC controllers. I know those can be refactored into a single bean or into WebMvcConfigurerAdapter but I couldn't find any examples. I don't have any views, it's a REST API...

How can I refactor those with java configuration? If possible I'd prefer to refactor those into a custom WebMvcConfigurerAdapter