从spring 文档中,您将看到 org.springframework.web.jsf.el.SpringBeanFacesELResolver:
首先委托给 Spring 的“业务上下文”WebApplicationContext,然后委托给底层 JSF 实现的默认解析器
对于 org.springframework.web.jsf.DelegatingVariableResolver:
将首先将值查找委托给底层 JSF 实现的默认解析器,然后委托给 Spring 的“业务上下文”WebApplicationContext
如您所见,行为非常不同。如果你不关心顺序,你很好,但如果你真的打算使用 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>