Thursday, December 26, 2013

Spring JSF integration

integration spring with jsf is easy, you just needs to follow these steps:
1)in web.xml make sure that you have (context listener + context param) :


org.springframework.web.context.ContextLoaderListener


contextConfigLocation


/WEB-INF/applicationContext*.xml
2) you need to use “DelegatingVariableResolver” in faces-config.xml:



org.springframework.web.jsf.DelegatingVariableResolver

…..
3) in the managed bean that you want to use the spring bean, you need to add spring bean to the managed bean class as property:





manager
#{manager}
Thats it :)

No comments: