Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/suresk/jsf-resources.com/wp-includes/functions-formatting.php on line 76

JSF and Spring are two excellent tools for J2EE development. Getting them to work together, however, can be a bit of fun. A cool library for integrating the two has been made available, however, and makes this task a fairly trivial one.

Simply download it here: JSF Spring Library.

Then in your web.xml, add the following:

[code lang=”java”]

RequestHandled

de.mindmatters.faces.spring.support.RequestHandledFilter



RequestHandled
*.jsf

org.springframework.web.context.ContextLoaderListener
de.mindmatters.faces.spring.support.ContextLoaderListener
[/code]

Now you should be able to access Spring beans from within JSF pages, as though they were part managed by JSF.