-
Jun 22nd, 2009, 11:11 AM
#1
Spring webflow and Tobago myfaces
Hi All,
we would like to integrate Myfaces tobago and spring webflow.I have all the required jar files in the application lib folder,modified web.xml,faces-config.xml ,added flow file and the config file.Application started with out errors.but i am unable to run the flow.Please help me with this.
I have spring-faces-2.0.7.RELEASE.jar ,spring-js-2.0.7.RELEASE.jar,spring-web-2.5.6.jar,spring-webflow-2.0.7.RELEASE.jar,spring-webmvc-2.5.6.jar,spring-core-2.5.6.jar in classpath.
in WEB-INF i have the following config files
faces-config.xml
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<application>
<variable-resolver>org.springframework.faces.webflow.FlowVar iableResolver</variable-resolver>
<property-resolver>org.springframework.faces.webflow.FlowPro pertyResolver</property-resolver>
<!-- Configuracion de mensajes globales -->
<locale-config>
<default-locale>es</default-locale>
<supported-locale>en</supported-locale>
</locale-config>
<lifecycle>
<phase-listener>org.springframework.faces.support.Request LoggingPhaseListener</phase-listener>
</lifecycle>
<lifecycle>
<phase-listener>
org.springframework.webflow.executor.jsf.FlowPhase Listener
</phase-listener>
</lifecycle>
</locale-config>
</application>
tobago-config.xml which has the style info
web.xml
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>sample Application</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/ctx-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.tobago.webapp.TobagoServl etContextListener</listener-class>
</listener>
<!-- Listener de spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.Requ estContextListener</listener-class>
</listener>
<!-- Listener, to allow Jetty serving MyFaces apps -->
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletCont extListener</listener-class>
</listener>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/META-INF/spring/ctx-*.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Spring web flow servlet mapping -->
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<!-- servlet-mapping -->
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
</web-app>
in WEB-INF/flows/test i have test-flow.xml
<?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/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<view-state id="enterData" view="enterData.jsp">
<transition on="success" to="viewData"/>
</view-state>
<view-state id="viewData" view="sampleview.jsp">
<transition on="search" to="enterData">
</transition>
</view-state>
<view-state id="enterData" view="sampleenter.jsp">
</view-state>
</flow>
in src/main/resources i have ctx-config.xml,ctx-webflow-config.xml,ctx-web-flows.xml which will go into war once after the build.
ctx-webflow-config.xml
<?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:faces="http://www.springframework.org/schema/faces"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schem...-beans-2.5.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schem...config-2.0.xsd
http://www.springframework.org/schema/faces
http://www.springframework.org/schema/faces/spring-faces-2.0.xsd">
<!-- Executes flows: the central entry point into the Spring Web Flow system -->
<webflow:flow-executor id="flowExecutor"/>
<!-- The registry of executable flow definitions -->
<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices" base-path="/WEB-INF/flows">
<webflow:flow-location-pattern value="/test-flow.xml"/>
</webflow:flow-registry>
<!-- Configures the Spring Web Flow JSF integration view-factory-creator="mvcViewFactoryCreator"-->
<faces:flow-builder-services id="facesFlowBuilderServices"/>
<!-- Handles requests mapped to the Spring Web Flow system -->
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.Flo wController">
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
</beans>
ctx-web-flows.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
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-2.5.xsd">
<!-- Maps request URIs to controllers -->
<bean id="flowUrlMappings" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
<property name="mappings">
<value>
/web/path/to/flow=flowController
/=flowController
</value>
</property>
<property name="defaultHandler">
<bean class="org.springframework.web.servlet.mvc.UrlFile nameViewController" />
</property>
</bean>
</beans>
ctx-config.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schem...g-util-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schem...ng-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schem...ing-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<context:annotation-config/>
<!-- Paquete desde donde se inicia la busqueda de backing beans configurados mediante anotaciones -->
</beans>
could you please let me know how to load the flow what is the url to run the flow test.if name of the project context is sample,also let me know whether i missed anything here.
Thanks
Kanth
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules