第一步:要在web.xml文件上部加入下列信息
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
第二步:要在faces-config.xml文件的上部加入下列信息
<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
</application>
在完成以上两步的配置后就可运行调试spring框架程序了
本文介绍了如何在Web应用中配置Spring框架与JSF的集成。主要步骤包括:在web.xml中配置ContextLoaderServlet,指定Spring配置文件的位置,并在faces-config.xml中设置变量解析器为DelegatingVariableResolver。
3335

被折叠的 条评论
为什么被折叠?



