JSF Backing Beans and Spring May 2, 2008Posted by Phill in General J2EE.
Tags: backing beans, jsf, Spring
In the Spring Documentation about JSF integration, the DelegatingVariableResolver (and a few alternatives) are explained. There is one thing it doesn’t mention explicitly, though, which is using Spring managed beans as backing beans.
As it happens, it’s fairly easy: you just need to use beans with request or session scope. There is a little bit of configuration needed for this, but you get the great benefits of having all your bean definitions in one place, as well as all the benefits of Spring managed beans and configuration!
Provided that you have the DelegatingVariableResolver (or one of the equivalents) set up, you can then use
your Spring managed beans in exactly the same way as you would use JSF managed beans.