Skip to content

Provide precise control over the attributes used in a redirect scenario [SPR-6796] #11462

Closed
@spring-projects-issues

Description

@spring-projects-issues

Jon Harper opened SPR-6796 and commented

There needs to be a way to issue a redirect using the String type and to specify that there should be no exposing of the model to the view.

One use case:
HandlerInterceptors are commonly used to add data to the model. If the controller supports POST request and does a redirect (which is the most common case) then the data added by the handler interceptor gets appended to the redirect url. This is undesirable. See http://forum.springsource.org/showthread.php?t=84140.

Another use case:
The controller uses a session attribute. The GET inserts into the model (session). The POST accepts a SessionStatus and calls status.setComplete() and then does a redirect using "redirect:view". The model data is still appended to the end of the redirected URL. The programmer now has to accept the ModelMap and call clear() on it. This should really not be required. See http://forum.springsource.org/showthread.php?p=275392.

Therefore there needs to be a very simple way (i.e. view String prefix ) to do a redirect without exposing the model to the view. I see this as the default use case and the case of exposing the model as a less common use case.

Jon


Affects: 3.0 GA

Reference URL: http://forum.springsource.org/showthread.php?t=84140

Issue Links:

3 votes, 4 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions