Target Unreachable dans JSF
Bonjour,
J'ai un souci pour definir une page JSF. Voici l'erreur que j'ai :
Code:
javax.el.PropertyNotFoundException: /EcrCreaDem.xhtml @20,63 value="#{demandeControler.demande.login}": Target Unreachable, 'demande' returned null
Je vous envoi les fichiers suivants :
web.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
| <?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">
<display-name>QueryTool</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- la servlet -->
<servlet>
<servlet-name>QueryTool</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml /WEB-INF/applicationContextSecurity.xml
</param-value>
</context-param>
<!-- le mapping des url *.html traité par Spring-->
<servlet-mapping>
<servlet-name>QueryTool</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<!-- le chargeur du contexte spring de l'application -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<!-- Spring Security Acegi -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<!-- Configuration de JSF / Facelets -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- mapping url géré par JSF / Facelets -->
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
com.sun.faces.config.ConfigureListener
</listener-class>
</listener>
<listener>
<listener-class>
com.sun.faces.application.WebappLifecycleListener
</listener-class>
</listener>
<!-- Fin configuration JSF / Facelets -->
<!-- Configuration de RichFaces -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>FacesServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<!-- Fin configuration de RichFaces -->
</web-app> |
applicationContext.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <?xml version="1.0" encoding="ISO_8859-1"?>
<!DOCTYPE beans SYSTEM "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- le fichier des messages -->
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename">
<value>messages</value>
</property>
</bean>
<!-- ========================= Start of DAO DEFINITIONS ========================= -->
<!-- TODO DAO Definition: Hibernate implementation -->
<bean id="idao" class="Dao.DaoImpl">
</bean>
<!-- ========================= Start of SERVICE DEFINITIONS ========================= -->
<!-- TODO Service Definition -->
<bean id="Imetier" class="Controler.MetierImpl">
<property name="idao">
<ref local="idao" />
</property>
</bean>
</beans> |
faces-config.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| <?xml version="1.0"?>
<!--
Copyright 2003 Sun Microsystems, Inc. All rights reserved.
SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
<managed-bean>
<description>
demandeBean qui fait reference au bean spring Demande
</description>
<managed-bean-name>demandeControler</managed-bean-name>
<managed-bean-class>
Controler.DemandeControler
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>demande</property-name>
<value>#{demande.login}</value>
</managed-property>
</managed-bean>
<navigation-rule>
<from-view-id>/EcrCreaDem.jsf</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/EcrGeneDem.jsf</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>failure</from-outcome>
<to-view-id>/j_spring_security_logout</to-view-id>
</navigation-case>
</navigation-rule>
<!-- This JSF variable resolver lets you reference JSF managed
beans from a Spring context, or a Spring bean from a managed bean -->
<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
<locale-config />
</application>
<lifecycle />
<factory />
</faces-config> |
Et dans ma page jsf, j'ecris :
Code:
1 2 3 4 5 6 7 8
|
<h:form >
<fieldset>
<h:inputText value="#{demandeControler.demande.login}">
<h:commandButton value="Valider" action="#{demandeControler.createDemande}"/>
<h:commandButton value="Annuler" type="reset"/>
</h:form>
</f:view> |
Et je ne vois pas d'ou vient mon erreur. C'est comme si mes beans defini dans faces-config n'était pas instanciés. Pourtant, elles sont définis...