Reputation: 629
I want to use spring with jsf in my project. So how can I use both in my project , can anyone can give an example how I can use both in my project.
Upvotes: 1
Views: 524
Reputation: 240900
Design point of view
You can use JSF as front part view
, and use Spring at Service and DAO layer of app.
Implementation point of view
in web.xml
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:application-context.xml
</param-value>
</context-param>
faces-config.xml
add variable resolver
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
</application>
Upvotes: 3