Skip to content

Improve documentation for HTTP redirects when using Portlet SimpleFormController (or any of its superclasses) [SPR-5140] #9813

@spring-projects-issues

Description

@spring-projects-issues

Mindaugas Žakšauskas opened SPR-5140 and commented

I have spent unproportionally high amount of time just trying to get a simple HTTP redirect working. Looked at the Javadocs, forums, etc. until asked a colleague who actually had traced this to Spring sources once after killing numerous hours. I think the Javadoc (and maybe the manual as well) must be improved to make this more clear.

The situation is simple: SimpleFormController handles a form submission, and needs to redirect to an external page/URL after it's done. The missing chain I (and most of other people I presume) missed there is to set the "redirectAction" to true. However, the crucial bit is that calling setRedirectAction( true ) is simply not enough - it needs to be called early, and preferably set in the portlet configuration. This, in my opinion, must be clearly explained in the header of Javadoc of org.springframework.web.servlet.view.RedirectView class, and possibly in the description of the redirectAction attribute itself.


Affects: 2.5.5

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