Details
Description
SPR-11541 encouraged me to open this issue
Currently one can easily register views to Controllers by WebMvcConfigurer as this:
/**
* Add view controllers to create a direct mapping between a URL path and
* view name without the need for a controller in between.
*/
void addViewControllers(ViewControllerRegistry registry);
What I would like to see is easy ways to provide mapping between common http status's such as 404, 301, 302 and 204. It would be great to have redirections, not founds and no contents controllers without the need for a controller by new registry types.
void addRedirectControllers(RedirectControllerRegistry registry); void addNoContentControllers(NoContentControllerRegistry registry); void addNotFoundControllers(NotFoundControllerRegistry registry);
This will greatly reduce unnecessary repeated codes.