Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Back button after flow ends results in HTTP Status 404

  1. #1
    Join Date
    Apr 2009
    Posts
    9

    Default Back button after flow ends results in HTTP Status 404

    Transitions take a flow from page to page. When the flow ends and the last page is displayed, a back button operation results in a Http Status 404.

    Instead of the Http Status display, I would like to redirect to a specific page. Is this doable?

    Also there seems to be no exception being raised. If so, an alternative would be to catch the exception and redisplay the last page.

    Commments/suggestions appreciated.

  2. #2
    Join Date
    Nov 2008
    Posts
    742

    Default

    Should be doable, though it's weird that you're getting a 404. The exception thrown should be a FlowExecutionRestorationFailureException.

    You should be able to catch the exception and display some kind of error page. For example, my error page states that the back button and browser history cannot be used beyond this point (since it's also triggered by going back past the number of saved snapshots). I also supply a "Resume" link which just does a javascript history.forward(), which should return you to the last valid page.

  3. #3

    Default

    What version of SWF are you using? What FlowUrlHandler are you using? Since you are getting 404, I am suspecting that there is something wrong with the flow definition URL which is generated by the FlowUrlHandler as it tries to restart the ended flow. Put a breakpoint in DefaultFlowUrlHandler.createFlowDefinitionUrl( ) right before you press back.
    Last edited by nkaza; May 8th, 2009 at 04:28 AM.

  4. #4

    Default

    If you are using FilenameFlowUrlHandler it might be a problem for which I have opened a Jira some time ago. I have fixed it by plugging in a custom implementation.

    http://jira.springframework.org/browse/SWF-1027

  5. #5
    Join Date
    Apr 2009
    Posts
    9

    Default

    Thanks InverseFalcon and nkaza for your interest/suggestions.

    I have not specified a FlowUrlHandler, so the DefaultFlowUrlHandler is the handler that is effective. I was able to break at method createFlowExecutionUrl() for each transition that occurred. However, the backbutton after the end of the flow did not cause the breakpoint break - so backbutton execution path did not engage the FlowUrlHandler.

  6. #6

    Default

    If you are using the FlowController, FilenameFlowUrlHandler is used implicitely. Did you try a breakpoint there?

    What URL can you see on the browser when 404 occurs?
    Last edited by nkaza; May 11th, 2009 at 03:30 PM.
    Nazaret Kazarian

  7. #7
    Join Date
    Apr 2009
    Posts
    9

    Default

    As it turns out an exception is indeed being raised - NoSuchFlowExcecutionException. What needs to be done is to register a handler to catch this (and any other) exception and re-render the current page.

    I do have a exception handler declared in the flow .xml. That handler is never invoked.

  8. #8

    Default

    Sorry, I lost you. You can see an exception on the browser? So there is no 404? NoSuchFlowExecutionException is by default caught by Spring web flow and by default it tries to restart the requested flow by calling createFlowDefinitionUrl( ). So you shouldn't be seeing a NoSuchFlowExecutionException on the screen in any case. Anyway, please provide some more information.

    By the way, you mentioned you put the breakpoint in createFlowExecutionUrl. The correct method is createFlowDefinitonUrl.
    Last edited by nkaza; May 11th, 2009 at 04:08 PM. Reason: typo in exception name
    Nazaret Kazarian

  9. #9
    Join Date
    Nov 2008
    Posts
    742

    Default

    Wait, what version of SWF are you using? I don't think NoSuchFlowExcecutionException is a part of SWF 2.0.x, is it?

  10. #10

    Default

    Quote Originally Posted by InverseFalcon View Post
    Wait, what version of SWF are you using? I don't think NoSuchFlowExcecutionException is a part of SWF 2.0.x, is it?
    NoSuchFlowExcecutionException is not. NoSuchFlowExecutionException is. Sorry about the typo.

    hmmm.. actually I copied the exception name from the previous post.
    Nazaret Kazarian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •