Hello,
I am using Spring 3.2 M2 + Spring webflow 2.3.1 + JSF 2.0. I am using Apache Tiles 2.0.5 for page layouts. When I am trying to launch the flow, I am getting FlowExecutionException. My flow is getting launched, but my view is not getting rendered.
webflow-config.xml -
flow-test.xml -Code:<?xml version="1.0" encoding="UTF-8"?> <?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:webflow="http://www.springframework.org/schema/webflow-config" xmlns:p="http://www.springframework.org/schema/p" xmlns:faces="http://www.springframework.org/schema/faces" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.2.xsd"> <!-- Executes flows: the central entry point into the Spring Web Flow system --> <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry" > <webflow:flow-execution-listeners> <webflow:listener ref="facesContextListener"/> <webflow:listener ref="flowExecutionListener"/> </webflow:flow-execution-listeners> </webflow:flow-executor> <!-- A listener maintain one FacesContext instance per Web Flow request. --> <bean id="facesContextListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener" /> <bean id="flowExecutionListener" class="com.helloworld.FlowExecutionListener"/> <!-- The registry of executable flow definitions --> <webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices"> <webflow:flow-location-pattern value="/WEB-INF/flows/flow-*.xml" /> </webflow:flow-registry> <!-- Configures the Spring Web Flow JSF integration --> <faces:flow-builder-services id="facesFlowBuilderServices" view-factory-creator="mvcViewFactoryCreator"/> <bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator" p:viewResolvers-ref="viewResolver" /> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> </bean> <faces:resources /> <!-- Enables FlowHandlers --> <!-- Dispatches requests mapped to flows to FlowHandler implementations --> <bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapter" p:flowExecutor-ref="flowExecutor"> <property name="flowExecutor" ref="flowExecutor" /> <property name="flowUrlHandler" ref="cassiopaeUrlHandler" /> </bean> <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping"> <property name="order" value="1"/> <property name="flowRegistry" ref="flowRegistry" /> <property name="flowUrlHandler" ref="urlHandler" /> </bean> <!-- Custom Url Handler to indentify the flow Id from URL. With latest webflow _flowId=flow-test doesnt start web flow automatically. --> <bean id="urlHandler" class="com.helloworld.UrlHandler"/> <!-- Dispatches requests mapped to org.springframework.web.servlet.mvc.Controller implementations --> <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" /> </beans>
web.xmlCode:<?xml version="1.0" encoding="UTF-8"?> <flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd" start-state="test-components"> <var name="testComponentBean" class="helloworld.TestComponentBean" /> <view-state id="test-components" view="/jsp/flowToTilesView.jspx"/> </flow>
I am launching the flow as http://HelloWord/faces/jsp/flowToTil...owId=test-flow.Code:<servlet> <servlet-name>Spring Dispatcher Servlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/config/webflow-config.xml</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Spring Dispatcher Servlet</servlet-name> <url-pattern>/faces/jsp/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping>
I am using tiles to render the definition that I receive from view id.
flowToTilesView.jspx
TilesDefinitionMapperBean - Return the Id of the view-state. I have created tiles definition similar to view nameCode:<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:tiles="http://tiles.apache.org/tags-tiles"> <jsp:directive.page contentType="text/html;charset=utf-8"/> <jsp:useBean id="mapper" class="com.helloworld.TilesDefinitionMapperBean" scope="page"/> <tiles:insertDefinition name="${mapper.tilesDefinitionName}" flush="false"/> </jsp:root>
Please let me know what I am missing.
-Sujay


Reply With Quote
