Announcement Announcement Module
Collapse
No announcement yet.
Can JSF and JSP coexist in Web Flow 2.2.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can JSF and JSP coexist in Web Flow 2.2.1

    I have been using web flow for years now and have several flows that use jsp pages as their view technology. I recently upgraded to web flow 2.2.1 and was looking to take advantage of the JSF technology. I have configured my app following the sample code that has been provided. However with the configuration below I can only get xhtml to work as my view technology. This is an issue because I have several jsp flows that work well and it doesn't make sense to rewrite.

    My main question is can JSF and JSP coexist in web flow 2.2.1 and if so how would I configure my web.xml and webflow-config.xml?

    Following works with JSF but now my jsp flows won't load:
    webflow-config.xml
    Code:
    	<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices">
        	<webflow:flow-location-pattern value="/WEB-INF/flows/*-flow.xml" />	    
    		</webflow:flow-registry>
    		
    	<!-- Installs a listener that creates and releases the FacesContext for each request. -->
    	<bean id="facesContextListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener"/>
    	
    	<!-- Configures the Spring Web Flow JSF integration -->
    	<faces:flow-builder-services id="facesFlowBuilderServices" development="true" />
    web.xml
    Code:
    	<!-- Just here so the JSF implementation can initialize, *not* used at runtime -->
    	<servlet>
    		<servlet-name>Faces Servlet</servlet-name>
    		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	
    	<!-- Just here so the JSF implementation can initialize -->
    	<servlet-mapping>
    		<servlet-name>Faces Servlet</servlet-name>
    		<url-pattern>*.faces</url-pattern>
    	</servlet-mapping>
    My pervious webflow-config looked like this (with jsp based flows):
    Code:
    		<webflow:flow-registry id="flowRegistry"  flow-builder-services="flowBuilderServices">
        	<webflow:flow-location-pattern value="/WEB-INF/flows/*-flow.xml" />	    
    		</webflow:flow-registry>
    		
    		<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>
    		<webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator"/>
    		
    		<bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
    		    <property name="viewResolvers" ref="viewResolver"/>
    		</bean>
    
    		<bean id="viewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
    			<property name="basename">
    				<value>views</value>
    			</property>
    		</bean>


    Thanks in advanced,

    Keith

  • #2
    Any thoughts on this one?

    Comment


    • #3
      Sorry for another bump

      Sorry for another bump

      Comment


      • #4
        Internally Web Flow executes all phases of the JSF lifecycle. Hence switching to JSF is a little more than just plugging in another rendering technology. What you will need to do is define two flow exectors with a separate flow registry + flow builder services for each.

        Comment

        Working...
        X