If a user is in the middle of a flow, and their flowExecutionKey expires, is it possible to retrieve the _flowId to redirect them back to the start of the flow they were originally in?
How would I do that?
If a user is in the middle of a flow, and their flowExecutionKey expires, is it possible to retrieve the _flowId to redirect them back to the start of the flow they were originally in?
How would I do that?
It is done for you by default as of Spring Web Flow 2.0 M4.
Keith
Keith Donald
Core Spring Development Team
Thanks for the help! I tried upgrading to webflow 2.0M4, from webflow 1.0 and so far so good.
A problem I've come across is how webflow defaults to the beginning of the flow . Currently, I'm adding a *.s extension to the spring mvc resources in our webapp. So in web.xml, I have:
As a result, the simple url mapping to the webflow I have is /create-code-flow.s. When the flow session expires, webflow tries to restart the flow by hitting /create-code-flow without the *.s extension.Code:<servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>*.s</url-pattern> </servlet-mapping>
I can't change the simple url mapping to use /create-code-flow unless I update the servlet mapping to use <url-pattern>/</url-pattern>, or I add a new servlet mapping for every new flow.
Is there a way to make the default restart flow behavior use the mapping specified in the simple url mapping, or does it have to default to the flow xml file name?
I've come across the same problem, and I also get it when hitting the browser back button on a flow end state. I'm using Web Flow 2.0.2. It seems the piece of code that generates the redirection URL is inside the DefaultFlowUrlHandler.createFlowDefinitionUrl method:
I assume the ending of the request URI should be parsed and appended before generating the '?' part - but I don't know, maybe this has already been fixed in 2.0.3? Haven't tried 2.0.3 yet.Code:public String createFlowDefinitionUrl(String flowId, AttributeMap input, HttpServletRequest request) { StringBuffer url = new StringBuffer(); url.append(getFlowHandlerUri(request)); url.append('/'); url.append(encode(flowId)); if (input != null && !input.isEmpty()) { url.append('?'); appendQueryParameters(url, input.asMap()); } return url.toString(); }
Anyway, I'd like to avoid adding an extra URL mapping for the flow Id, so hopefully, this will be fixed soon!![]()