Announcement Announcement Module
Collapse
No announcement yet.
Catching exceptions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Catching exceptions

    I have successfully created a webflow - but I would like to catch the following exception and redirect back to the application - preferrably the first page.

    org.springframework.webflow.execution.repository.N oSuchFlowExecutionException

    I have placed this into my web.xml to no avail. Other exceptions are successfully caught and redirect to the application - but not necessarily the first page.

    At any rate, I simply don't want the user to see the exception ... if, say, the server restarts or they somehow get out of sync. What is the best way to handle or manage this?

    Thanks,

    -Luther

  • #2
    This is a common problem. I've used a servlet filter that redirects back to the initial flow and takes in my default flow id as an init param. I think Kieth and them are looking at how to handle this for a later release.

    Comment


    • #3
      Thanks

      Ah ... thanks.

      Ok - so user is merrily walking through my flow ... The server is somehow restarted and now, the user's _flowExecutionKey is out of sync.

      In your example, you have a servlet filter intercepting each request - so, you can look at the _flowExecutionKey ... but how do you know whether or not the _flowExecutionKey is out of sync? Is there a direct call into the webflow framework that lets you determine this?

      And ... assuming you find it ... all I've every really done in a filter is chain to the next filter ... In your case, how do you "wipe" that parameter out and send it to the relevant url?

      For what its worth, I have a defaultFlowId setup in my config file - so the URL never changes. For instance, all submissions go to /wizard. I guess I'm not sure I'd be directing to a new URL --- since in my case, the entire app uses only one. I was thinking I'd need to remove the _flowExecutionKey so the webflow thinks it needs to start over. Heck, I'd be happy sending it directly to an END-STATE even ...

      Thanks for any suggestions. I'm not opposed to creating a different urls ... its just that non of my links need any href ... since everything I'm concerned about just keeps submitting back to the same flow.

      -Luther
      Last edited by lutherbaker; Jul 20th, 2007, 11:15 AM.

      Comment


      • #4
        I was talking more about just wrapping your filterChain.doFilter call in a try catch block and catching the exception. If you want you can get a reference to the conversationManager and see if the given conversation exist (the first part of the key). If it doesn't exist you can redirect to the correct URL. In your case if you just have one URL for everything just redirect back to the URL without the requestParameters.

        Comment


        • #5
          WebFlow 1.1 should enable this: http://opensource.atlassian.com/proj...browse/SWF-158

          Comment

          Working...
          X