当我使用JSF时,我能够加载任何xhtml页面,然后我想添加spring。我转到文档jsf spring integration并在我的faces-config.xml中添加了el-resolver:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
</faces-config>
现在,当我尝试加载页面时,它会给出错误:
javax.servlet.ServletException:找不到WebApplicationContext:否 ContextLoaderListener注册了吗? javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
答案 0 :(得分:3)
您必须在org.springframework.web.context.ContextLoaderListener
WEB-INF\web.xml
侦听器
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
答案 1 :(得分:0)
解决方案是:
如果使用高于3.2的弹簧版本,则不需要弹簧asm,因为它包含在弹簧芯中。它与spring-core冲突并抛出其他例外。