Announcement Announcement Module
Collapse
No announcement yet.
SpringWebFlowExceptionResolver support for SWF 1.0.x Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringWebFlowExceptionResolver support for SWF 1.0.x

    Hi everybody,

    I have finally posted an update to my SpringWebFlowExceptionResolver code with support for SWF 1.0.x. For details and to download the code, check out the JIRA issue:

    http://opensource.atlassian.com/proj...browse/SWF-158

    I invite people to give it a try and provide feedback on any issues you might have with it!

    And who knows... if it meets enough people's needs, maybe it will be included in a feature release of SWF.

    cheers,

    Sam

  • #2
    hey sam,
    is there an easy way to simply redirect to some non-flow error page instead of launching the defaultFlowId when an exception is caught? i'm using the latest version of SpringWebFlowExceptionResolver (1.8).

    Comment


    • #3
      Use SimpleMappingExceptionResolver instead of SpringWebFlowExceptionResolver

      Hi fadetoblack,

      Sorry I didn't get back to you sooner, but I was away on vacation.

      Originally posted by fadetoblack View Post
      is there an easy way to simply redirect to some non-flow error page instead of launching the defaultFlowId when an exception is caught? i'm using the latest version of SpringWebFlowExceptionResolver (1.8).
      Yes, indeed. There is a much simpler way. In fact, you don't even need to bother with SpringWebFlowExceptionResolver if you just want to display an error page. This functionality comes out-of-the-box with the Spring MVC framework.

      Take a look at SimpleMappingExceptionResolver, which SpringWebFlowExceptionResolver extends.

      Here's a short mention of it in the reference manual: http://static.springframework.org/sp...eptionhandlers

      Here's the JavaDoc: http://www.springframework.org/docs/...nResolver.html

      And here's an example to get you started:

      Code:
      <bean id="simpleMappingExceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
      	<property name="defaultErrorView" value="error/generalError" />
      	<property name="exceptionMappings">
      		<props>
      			<prop key="org.springframework.webflow.conversation.NoSuchConversationException">error/abortedWebFlowException</prop>
      		</props>
      	</property>
      </bean>
      Hope this helps,

      Sam

      Comment


      • #4
        excellent, thanks for the help!

        Comment


        • #5
          Hi Sam,

          is there any plan to make the code compatible with java 1.4 in the future ?
          Because people like me have to fight with websphere and jdk 1.4.2 @ the customers.

          best regards
          lyserg

          Comment


          • #6
            Hi Lyserg,

            Originally posted by Lyserg View Post
            is there any plan to make the code compatible with java 1.4 in the future ?
            Because people like me have to fight with websphere and jdk 1.4.2 @ the customers.
            I originally created the code for myself, and I've been using JDK 1.5. So I naturally used the new language features (for hopefully obvious reasons ).

            You are the first person to voice an interest in removing the JDK 1.5 dependency; however, I imagine there are others. Besides, if it does get merged into the SWF core, it would need to be backwards compatible.

            Long story short: I'll be away on business the rest of this week, but I'll try to update the code for JDKs < 1.5 some time next week.

            cheers,

            Sam

            Comment


            • #7
              SpringWebFlowExceptionResolver no longer dependent on JDK 1.5

              Hi lyserg,

              Originally posted by Lyserg View Post
              Hi Sam,

              is there any plan to make the code compatible with java 1.4 in the future ?
              Because people like me have to fight with websphere and jdk 1.4.2 @ the customers.

              best regards
              lyserg
              Check out version 1.10, which I uploaded today to JIRA:

              http://opensource.atlassian.com/proj...browse/SWF-158

              I think (hope) that will solve your JDK 1.4 compatibility issues. Please give it a try and let me know how it works out!

              cheers,

              Sam

              Comment


              • #8
                Hi Sam,

                great, i will give it a try on next week.

                thanks a lot in advance

                regards
                lyserg

                Comment


                • #9
                  Hi,

                  I was able to use this exception resolver class and it is really great.
                  However, since it does redirect - url resolver is unable to propagate exception into the model for resolved error view. At least i could not access ${exception} after this resolver was executed.
                  Does someone know how exception can be propagated? It can be useful to display errors to users sometimes, instead of just restarting the flow.

                  Thanks,
                  Radovan

                  Comment

                  Working...
                  X