Open fabien-chebel opened 2 years ago
Spring Web MVC allows performing redirections by returning a String prefixed by redirect:// in the controller.
redirect://
This String is intercepted by ThymeleafViewResolver which maps it to an instance of RedirectView.
ThymeleafViewResolver
RedirectView
The default behaviour of RedirectView is to include all model attributes as query parameters.
This behaviour may not be desirable and thymeleaf-spring does not provide a way to easily change it.
Expose a method called setRedirectExposeModelAttributes in ThymeleafViewResolver to allow overriding this behaviour.
setRedirectExposeModelAttributes
Context
Spring Web MVC allows performing redirections by returning a String prefixed by
redirect://
in the controller.This String is intercepted by
ThymeleafViewResolver
which maps it to an instance ofRedirectView
.Problem
The default behaviour of
RedirectView
is to include all model attributes as query parameters.This behaviour may not be desirable and thymeleaf-spring does not provide a way to easily change it.
Suggested fix
Expose a method called
setRedirectExposeModelAttributes
inThymeleafViewResolver
to allow overriding this behaviour.