Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: how to register custom FlowExecutionExceptionHandler? we are increasing finding this.

  1. #11
    Join Date
    Oct 2008
    Posts
    286

    Default xml setteings update

    web.xml
    Code:
    ...
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value><![CDATA[
    			classpath:data-access-config.xml,
    			classpath:service-config.xml,
    			classpath:bl-config.xml,
    			classpath:dao-config.xml,
    			classpath:webmvc-config.xml,
    			classpath:webflow-config.xml,
    			classpath:controller-config.xml,
    			classpath:security-config.xml,
    		]]></param-value>
    	</context-param>
    	
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<servlet>
    	    <servlet-name>resources</servlet-name>
    	    <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
    	    <load-on-startup>0</load-on-startup>
    	</servlet>
    	
    	<servlet>
    		<servlet-name>springproj</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    	    <init-param>
    	        <param-name>contextConfigLocation</param-name>
    	        <param-value></param-value>
    	    </init-param>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    ...
    webflow-config.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:flow="http://www.springframework.org/schema/webflow-config"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    		http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">
    
    	<!-- Executes flows: the entry point into the Spring Web Flow system -->
    	<flow:flow-executor id="flowExecutor" flow-registry="flowRegistry" >
    		<flow:flow-execution-listeners>
    			<flow:listener ref="securityFlowExecutionListener"/>
    		</flow:flow-execution-listeners>
    	</flow:flow-executor>
    	
    	<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener">
    	</bean>
    	
    	<!-- The registry of executable flow definitions -->
    	<flow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
        	<flow:flow-location-pattern value="/WEB-INF/flows/**/*-flow.xml"/>
    	</flow:flow-registry>
    
    	<flow:flow-builder-services id="flowBuilderServices" development="true" 
    		view-factory-creator="mvcViewFactoryCreator" />
    
    	<bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
        	<property name="viewResolvers" ref="tilesViewResolver"/>
    	</bean>
    	
    	<bean id="customTransitionExecutingFlowExecutionExceptionHandler" class="xyz.web.exception.CustomTransitionExecutingFlowExecutionExceptionHandler">
    	</bean>
    
    </beans>
    flow definition
    Code:
    	....
    	<!-- END -->
    	<end-state id="end" view="externalRedirect:/xxx/xxx-flow" />
    
    	<exception-handler bean="customTransitionExecutingFlowExecutionExceptionHandler"/>
    <!--	<bean-import resource="beans.xml"/>-->
    	
    </flow>
    but still the error remains..
    Last edited by eros; May 11th, 2010 at 11:41 PM.
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  2. #12
    Join Date
    Nov 2008
    Posts
    742

    Default

    Quote Originally Posted by eros View Post
    do you mean, defining in the applicationContext?
    There are several ways to do this, and you aren't limited to a single file.

    For example, my file is called "web-application-config.xml", and all it does is import the other xml files in the same directory.

    Each one has their own purpose. I've got a dao-config.xml, webflow-config.xml, webmvc-config.xml, flow-security-config.xml, flow-utils.xml (for helper beans I've written), and an application-beans.xml (for all of my application-specific beans).

    However, from what you've posted, it SHOULD be working...At this point I'm baffled. The bean is defined, and you're referencing it properly... I don't know what to tell you here. Something subtle is going on, so play around with it and see if you can figure it out.

  3. #13
    Join Date
    Oct 2008
    Posts
    286

    Default

    >Sir InverseFalcon,
    Thanks a lot for spending time to share us your knowledge...

    i can't create a jira for this because others able to set it up properly and working...

    i think, need to beg a time to Spring Webflow Team... to guide me on how to figure it out...
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  4. #14
    Join Date
    Oct 2008
    Posts
    286

    Default

    my main goal is
    1) throw exception
    2) cancel the transition to subflow
    3) back to originating state
    3) display an error message

    in my other scenario (A scenario):
    1) catching the exception
    2) set the error message code to messageContext
    3) then its automatically back to originating state and it displays the corresponding error message.

    my problem is... when I use A scenario, its still do the transition to subflow.. in other word, the behavior is different if you set the <transition on to> to a subflow state... it doesn't do the 3) of A scenario...

    that's why I would like to implement an exception handler to handle that behavior (a bug?)....

    >to Spring Webflow Team,
    please guide me on how to figure it out because its something different... cannot see in any documentation.. thanks a lot..

    any hints/ideas are highly appreciated.
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

Posting Permissions

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