Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver

markitus82 picture markitus82 · Jul 29, 2009 · Viewed 24.9k times · Source

I am trying to integrate Spring into a JSF application.

In faces-config.xml, I have included this:

<application>       
  <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
  <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>

but it shows a weird warning which I can't get rid of:

Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver

Any ideas?

Answer

Lucas picture Lucas · Jul 29, 2011

From the spring documentation, you will see that for org.springframework.web.jsf.el.SpringBeanFacesELResolver:

delegates to the Spring's 'business context' WebApplicationContext first, then to the default resolver of the underlying JSF implementation

and for org.springframework.web.jsf.DelegatingVariableResolver:

will first delegate value lookups to the default resolver of the underlying JSF implementation and then to Spring's 'business context' WebApplicationContext

As you can see, the behavior is very different. If you don't care about order, you are fine, but if you actually did intend to use org.springframework.web.jsf.el.SpringBeanFacesELResolver then all you have to do is ensure the version of el-api.jar in your dependencies is compatible with your version of spring. For me, I have this (in my 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>