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

  • webflow exception handling

    i'm pretty new to webflow and in fact spring mvc in general and was having trouble getting exception handling working in a flow. i can't seem to find good examples of this.

    basically what i want to do is pretty simple.. when a flow completes (end-state is reached) and the user presses the back button, i want to catch the nosuchflowexecution/nosuchconversation exception and display an error page. this doesn't seem to work:

    a bunch of view/action states

    <view-state id="error" view="error" />

    <end-state id="completed" view="externalRedirect:redirectURL" />

    <global-transitions>
    <transition on-exception="org.springframework.webflow.execution.r epository.NoSuchFlowExecutionException" to="error" />
    <transition on-exception="org.springframework.webflow.conversatio n.NoSuchConversationException" to="error" />
    </global-transitions>


    can someone show me a simple example of how to do this or point out what im doing wrong?

    thanks
    Last edited by fadetoblack; Apr 5th, 2007, 01:28 PM.

  • #2
    This is one of those questions we definitely need a FAQ or tip for.

    Those exceptions you're trying to catch are thrown OUTSIDE the flow execution -- by the webflow system -- because access to a flow execution could not be granted (either because it ended, expired, or the definition didn't exist). The caller of SWF must catch these exceptions and route to an appropriate error page. Sam Brennan has submitted a patch to our JIRA system that provides Spring MVC exception resolver code that will do this handling for you. I'd definitely recommend checking that out.

    In 1.1 we will address this out-of-the-box.

    Keith

    Comment


    • #3
      thanks for the reply. i'm still confused about how to solve the problem though (again, im really new at spring & webflow). since the exception is thrown outside the flow how would i catch it when the back button is pressed? does the patch you mentioned allow you to do this? also, im not familiar with JIRA, could you please point me to the patch?

      thanks.

      Comment


      • #4
        See http://forum.springframework.org/showthread.php?t=36960

        Comment


        • #5
          great, thanks!

          Comment

          Working...
          X