Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow hiding model attributes in redirects #299

Open
wants to merge 1 commit into
base: 3.1-dev
Choose a base branch
from

Commits on Jul 12, 2022

  1. Allow hiding model attributes in redirects

    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 of `RedirectView`.
    
    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` in `ThymeleafViewResolver` to allow overriding this behaviour.
    fabien-chebel committed Jul 12, 2022
    Configuration menu
    Copy the full SHA
    c6c0d6d View commit details
    Browse the repository at this point in the history