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

  • Exception handling tips

    Hi,

    I was wondering if there's a set of comprehensive exception handling tips to make a webflow app robust.
    I know everything can be configured, but in the end there are so many options, it's not clear what is needed for what.

    What I'd like to solve are things like:
    1. When I add a character behind the URL of a flow (=the 'execution' parameter), I get a "resource not found" error
    2. How to handle it gracefully when somebody tries to access a nonexisting page

    I have the following defined in my flows:
    Code:
    	<view-state id="error" view="/WEB-INF/error.xhtml"></view-state>
    	<global-transitions>
    	<transition on-exception="java.lang.Exception" to="error"></transition>
    	<transition on="org.springframework.security.access.AccessDeniedException"/>
    	</global-transitions>
    In webmvc-config.xml I've also created a bean which is a subclass of SimpleMappingExceptionResolver

    Does anybody have any tips on how they make their apps robust?

    Best regards, Bo

  • #2
    Another problem I have is that when a valid URL followed by a slash is requested (f.e. /spring/web/home/), I get an exception because webflow tries to find ".html" while I'd want it to map back to "home". So trailing slashed should be trimmed.

    Would the way to go be to customize a child of org.springframework.web.servlet.mvc.UrlFilenameVie wController, to strip trailing slashes?

    cheers, Bo

    Comment


    • #3
      P.D. my current configuration is:

      Code:
      	<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
      		<property name="order" value="1" />
      		<property name="flowRegistry" ref="flowRegistry" />
      		<property name="defaultHandler">
      			<!-- If no flow match, map path to a view to render; e.g. the "/intro" 
      				path would map to the view named "intro" -->
      			<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
      		</property>
      		<property name="interceptors">
      			<list>
      				<ref bean="localeChangeInterceptor" />
      			</list>
      		</property>
      	</bean>
      
      	<!-- Maps logical view names to Facelet templates in /WEB-INF (e.g. 'search' 
      		to '/WEB-INF/search.xhtml' -->
      	<bean id="faceletsViewResolver"
      		class="org.springframework.web.servlet.view.UrlBasedViewResolver">
      		<property name="viewClass" value="org.springframework.faces.mvc.JsfView" />
      		<property name="prefix" value="/WEB-INF/" />
      		<property name="suffix" value=".xhtml" />
      	</bean>
      I'm using webflow 2.2.1, JSF

      Comment

      Working...
      X