Results 1 to 5 of 5

Thread: webflow exception handling

  1. #1
    Join Date
    Apr 2007
    Posts
    14

    Default 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 at 12:28 PM.

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    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
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Apr 2007
    Posts
    14

    Default

    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.

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Keith Donald
    Core Spring Development Team

  5. #5
    Join Date
    Apr 2007
    Posts
    14

    Default

    great, thanks!

Posting Permissions

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