[英]using spring with jsf
我想在項目中使用spring和jsf。 因此,我該如何在我的項目中同時使用兩者,有人可以舉一個例子說明我如何在我的項目中同時使用兩者。
設計觀點
您可以將JSF用作前view
,並在應用程序的Service和DAO層使用Spring。
實施觀點
在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
添加變量解析器
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
</application>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.