Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/09/2010, 14:47
jcisneros
 
Fecha de Ingreso: noviembre-2009
Mensajes: 9
Antigüedad: 14 años, 6 meses
Puntos: 0
Pregunta Al intentar obtener el Contexto JSF me devuelve null

Buenas noches,

Actualmente estoy realizando una aplicación web con JSF + SPRING + HIBERNATE, pero tengo un problema. Cuando intento obtener el Contexto JSF mediante FacesContext.getCurrentInstance(), me devuelve null. No se si me faltara alguna configuración en el web.xml...

¿Podrían ayudarme? Le adjunto el código del web.xml por si le quieren echar un vistazo. De antemano muchísimas gracias.

Saludos!!

Código:
<?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_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>


	<context-param>
		<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
		<param-value>com.sun.facelets.FaceletViewHandler</param-value>
	</context-param>

	<context-param>
		<description>Indicar que el estado de la vista será guardado en el cliente y no en el servidor</description>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>client</param-value>
	</context-param>



	<context-param>
		<description>Setting this to true will cause the FaceletViewHandler to print out debug information</description>
		<param-name>facelets.DEVELOPMENT</param-name>
		<param-value>true</param-value>
	</context-param>
	
	<listener>
		<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
	</listener>

	<listener>
		<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
	</listener>
	<!--
		Listener implementation to handle web application lifecycle events
	-->
	<listener>
		<listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
	</listener>

	<!-- [inicio] SPRING SECURITY -->
	<!--
		<listener>
		<listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>
		</listener>
	-->
	<!-- [fin] SPRING SECURITY -->

	<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>

	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>


	<!--
		filtro para que todas las peticiones al Faces Servlet pasen
		previamente por el filtro de Ajax4jsf
	-->
	<filter>
		<display-name>Ajax4jsf Filter</display-name>
		<filter-name>Ajax4jsf</filter-name>
		<filter-class>org.ajax4jsf.Filter</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>Ajax4jsf</filter-name>
		<servlet-name>Faces Servlet</servlet-name>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>

	<!-- Spring -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
        	classpath:applicationContext-hibernate.xml
        	classpath:applicationContext-service.xml
        	classpath:applicationContext-delegate.xml
			classpath:applicationContext-form.xml
     </param-value>
	</context-param>

	<listener>
		<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
	</listener>
</web-app>