Utilisation spring avec jsf
Salut,
J'ai intégré spring et jsf comme indiqué dans la faq.
Dans le web.xml
Code:
1 2 3 4 5 6 7 8
| <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param> |
Dans faces-config.xml :
Code:
1 2 3 4 5
| <application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
</application> |
Puis dans mon managed-bean :
Code:
1 2 3 4
| <managed-property>
<property-name>tutu</property-name>
<value>#{tutuManager}</value>
</managed-property> |
Seulement au demarrage du serveur j'ai l'exception suivante :
Code:
1 2
| org.apache.jasper.JasperException: javax.servlet.jsp.JspException: javax.faces.FacesException: javax.faces.el.EvaluationException: Erreur dans l'expression: Object nommé 'tutuManager' ne peut 'tre trouvé.
... |
Or quand j'essaye de recuperer mon bean manuellement le code suivant fonctionne :
Code:
1 2
| ApplicationContext ctx = FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());
ctx.getBean("tutuManager"); |
Des idées ?
J'utilise jsf 1.1, tomcat 5.5, spring 1.2