Announcement Announcement Module
Collapse
No announcement yet.
Problem integration spring mvc + jsf 2.1. I can see the views Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem integration spring mvc + jsf 2.1. I can see the views

    Hi, i'm developing a project with spring+spring mvc +webflow+jsf 2.1 +hibernate+jpa. I've problem when y try to view a xhtml but i think my configuration is ok. when the project is runs i can see the view:

    The error
    Attachment


    My configuration


    web.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    	id="WebApp_ID" version="3.0">
    
    	<display-name>AirTour</display-name>
    
    	<welcome-file-list>
    		<welcome-file>index.html</welcome-file>
    	</welcome-file-list>
    
    	<!-- SPRING -->
    	
    	
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
                /WEB-INF/conf/applicationContext.xml
             </param-value>
    	</context-param>
    
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    	<listener>
    		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    	</listener>
     
     
     	<!-- SPRING MVC & WEBFLOW -->
    	 <servlet>
    	    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    	    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    	    <init-param>
            	<param-name>contextConfigLocation</param-name>
            	<param-value>/WEB-INF/conf/webflow-config.xml</param-value>
        </init-param>
    	    <load-on-startup>1</load-on-startup>
    	</servlet>
     
    	 <servlet-mapping>
    	    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    	    <url-pattern>/app/*</url-pattern>
    	</servlet-mapping>
     
      
     
    	<!-- JSF -->
    
    	<context-param>
    		<param-name>javax.faces.PROJECT_STAGE</param-name>
    		<param-value>Development</param-value>
    	</context-param>
    	
    	<context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                <param-value>.xhtml</param-value>
        </context-param>
    
      	<context-param>
      		<param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
      		<param-value>1</param-value>
      	</context-param>
    
    	<servlet>
    		<servlet-name>Faces Servlet</servlet-name>
    		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	
    	<servlet-mapping>
    		<servlet-name>Faces Servlet</servlet-name>
    		<url-pattern>*.faces</url-pattern>
    	</servlet-mapping>
    </web-app>
    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:faces="http://www.springframework.org/schema/faces"
    	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.xsd
    		http://www.springframework.org/schema/faces  http://www.springframework.org/schema/faces/spring-faces-2.2.xsd
    		http://www.springframework.org/schema/webflow-config
    		http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd">
    
    	<!-- 
    		Enable processing of JSF 2 resource requests. For example:
    		/webflow-primefaces-showcase/app/javax.faces.resource/jsf.js?ln=javax.faces
    	-->
    	<faces:resources />
    
    	
    	<!--
            Maps request paths to flows in the flowRegistry; e.g. a path of
            /registration-flow looks for a flow with id "registration-flow"
        -->
        <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
            <property name="flowRegistry" ref="flowRegistry" />
        </bean>
    	
    	
    	
    	<bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapter">
            <property name="flowExecutor" ref="flowExecutor" />
        </bean>
    	
    	
    	
    	<flow:flow-executor id="flowExecutor">
    		<flow:flow-execution-listeners>
    			<flow:listener ref="facesContextListener" />
    		</flow:flow-execution-listeners>
    	</flow:flow-executor>
    	
    
    	<flow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="/WEB-INF/flows">
    		<flow:flow-location-pattern value="/**/flow.xml" />
    	</flow:flow-registry>
    
    
    	<faces:flow-builder-services id="flowBuilderServices" development="true" />
    
    	<bean id="facesContextListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener" />
    
    
    	<!--
    		Resolves views selected for rendering by @Controllers to .xhtml
    		resources in the /WEB-INF/views directory
    	-->
    	<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    		<property name="viewClass" value="org.springframework.faces.mvc.JsfView" />
    		<property name="prefix" value="/WEB-INF/views/" />
    		<property name="suffix" value=".xhtml" />
    	</bean>
    
    </beans>
    face-config.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"
    	version="2.1">
    
    
    	<application>
    		<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
    		<locale-config>
    			<default-locale>es_ES</default-locale>
    			<supported-locale>es_ES</supported-locale>
    		</locale-config>
    	</application>
    
    </faces-config>
    index.html
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"
    	version="2.1">
    
    	<!-- **** INTEGRACION CON SPRING **** -->
    	<application>
    		<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
    		<locale-config>
    			<default-locale>es_ES</default-locale>
    			<supported-locale>es_ES</supported-locale>
    		</locale-config>
    	</application>
    
    </faces-config>

    home.xhtml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core">
    	
    <h:body>
    
    	<h:dataTable value="#{controladorUsuarios.infoUsuario()}" var="usuarios">
    		<h:column>
    			<f:facet name="header">
    				<h:outputText value="Nombre" />
    			</f:facet>
    			<h:outputText value="#{usuarios.nombre}" />
    		</h:column>
    		<h:column>
    			<f:facet name="header">
    				<h:outputText value="Apellidos" />
    			</f:facet>
    			<h:outputText value="#{usuarios.apellidos}" />
    		</h:column>
     	</h:dataTable>
    	<h:link value="Registro" outcome="registro/registro" />
    
    </h:body>
    
    </html>
    My project

    Attachment

    What's the problem?
    Attached Files
Working...
X