我正在尝试将 Spring 集成到 JSF 应用程序中。
In faces-config.xml
,我已经包括了这个:
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
但它显示了一个我无法摆脱的奇怪警告:
Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver
有任何想法吗?
来自弹簧文档 http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/web-integration.html#jsf,您将看到 org.springframework.web.jsf.el.SpringBeanFacesELResolver:
委托给 Spring 的“业务上下文”WebApplicationContext
首先,然后到底层 JSF 的默认解析器
执行
对于 org.springframework.web.jsf.DelegatingVariableResolver:
首先将值查找委托给默认解析器
底层 JSF 实现,然后是 Spring 的“业务上下文”
Web应用程序上下文
正如您所看到的,行为非常不同。如果你不关心顺序,那没问题,但如果你确实打算使用 org.springframework.web.jsf.el.SpringBeanFacesELResolver 那么你所要做的就是确保你的 el-api.jar 的版本依赖项与您的 spring 版本兼容。对我来说,我有这个(在我的 Maven pom 中):
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.5.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>el-api</artifactId>
<version>6.0.32</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)