Reputation: 2424
In our JSF 2, spring 3 web application we have the following sets of entries in the web.xml to integrate spring and JSF
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/spring/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
And it works!
However, after going through quiet a few JSF & spring tutorials I see the need to define a RequestContextListener in addition to the ContextLoaderListener.
We have both request scope and session scope beans in our application.
Are both listeners mandatory? What is the consequence of not defining the RequestContextListener?
Upvotes: 1
Views: 6131
Reputation: 6630
both are not mandatory, only the ContextLoaderListener
see http://static.springsource.org/spring/docs/3.0.x/reference/web-integration.html and http://forum.springsource.org/showthread.php?t=81382
the RequestContextListener seems to be mandatory for Facelets
This listener is mainly for use with third-party servlets, e.g. the JSF FacesServlet.
Upvotes: 1