Results 1 to 4 of 4

Thread: Can JSF and JSP coexist in Web Flow 2.2.1

Hybrid View

  1. #1

    Default 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. #2

    Default

    Any thoughts on this one?

  3. #3

    Default Sorry for another bump

    Sorry for another bump

  4. #4
    Join Date
    Aug 2006
    Location
    Brooklyn
    Posts
    556

    Default

    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.

Posting Permissions

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