This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

RequestContext.getFlowExecutionUrl() is null in on-entry actionPage Title Module

RequestContext.getFlowExecutionUrl() is null in on-entry action

Mar 4th, 2010, 11:32 AM

I have an action in which I need to get at the flowExecutionUrl. There is a method on the RequestContext called getFlowExecutionUrl() , but it returns a blank string. The flowExecutionUrl is available in my freemarker view though. Any idea why it is not available in the on-entry action?

Keep in mind SWF is using the POST-REDIRECT-GET pattern under the hood, and on-entry actions occur before the REDIRECT. I suspect the new flowExecutionURL is generated after the redirect. You may want to try changing this to an on-render action and see what happens.

Comment

Glad you've got it working. Although the POST-REDIRECT-GET pattern is central to the way SWF operates and how it is able to support browser back button usage, it isn't talked about nearly enough in the reference guide. In a similar manner, requestScope and request parameters will get blown away by the redirect, so if they are added to the scope before your view-state, they will only be usable in on-entry actions but not in on-render actions. Tricky stuff, if you aren't aware of what it's doing behind the scenes.

I've got no official affiliation with the SWF project or SpringSource (unless Keith's team is hiring anytime soon?). I do have a fondness for this particular framework, having used it for the latest project at my workplace. It has weaknesses, of course, in both documentation and areas of its implementation, but compared with previous projects I've done with Struts or JSF, it's a godsend. In any case, I really want to see SWF succeed and grow, so I occasionally pop in on the forums and see where I can help.