2 Replies Latest reply on Apr 27, 2015 7:45 AM by chrisjr

    WELD Servlet 2.2.x, javax.el and Tomcat 7

    chrisjr

      Hi,

       

      I've been using WELD 2.2.x and Tomcat 7 successfully for a while now, but I've just noticed that WELD 2.2.x is asking for javax.el:javax.el-api:3.0.0. I've been using Tomcat 7's internal org.apache.tomcat:tomcat-el-api dependency instead via "provided" scope, but this only seems to be equivalent to javax.el:el-api:2.2.

       

      Is using EL-API 2.2 instead of 3.0 going to be a problem, please? I don't remember reading anything about this in the WELD 2.1 -> 2.2 upgrade notes. Do I need to ignore Tomcat 7's javax.el now and provide my own? Which "expressions" is this library being used for anyway? And is any of this even relevant to weld-servlet in the first place?

       

      Cheers,

      Chris

       

      P.S. Before upgrading to WELD 2.2, I was using weld-servlet 2.1.2.Final in Tomcat 7. And weld-core 2.1.2.Final also has a dependency on org.jboss.spec.javax.el:jboss-el-api_3.0_spec-1.0.0.Alpha1, despite being an implementation of CDI 1.1 which declares a dependency on javax.el:el-api 2.2. So I have no idea if weld-servlet 2.2.x's dependency on EL 3.0 is real, or whether someone is just putting arbitrary numbers in POMs.

        • 1. Re: WELD Servlet 2.2.x, javax.el and Tomcat 7
          mkouba

          Hi Chris,

          Weld 2.2 is a CDI 1.2 implementation (see also What is the relation between Weld, CDI and Java EE versions?) and as such depends on Java EE 7 APIs. However, it does not make use of any EL 3.0 feature and it should not be affected by new coercion rules (the only backward incompatible change I've found in the EL spec). So it should be safe to use EL 2.2 instead. WRT the usage - a CDI implementation must provide an ELResolver that resolves bean names (see also 12.5. Integration with Unified EL) and there are some rules for using dependent pseudo-scope in expressions (see also 6.4.3. Dependent pseudo-scope and Unified EL).

           

          PS. Weld 2.1 should depend on EL 3.0 as well (the target is also Java EE 7).

          • 2. Re: WELD Servlet 2.2.x, javax.el and Tomcat 7
            chrisjr

            Hi Martin, thanks for the reply.

             

            I assumed that WELD 2.1.x required EL 2.2 because WELD 2.1.x supported CDI 1.1. And one of the Maven dependencies for javax.enterprise:cdi-api:1.1 is listed as javax.el:el-api:2.2. However, I'm not using JSP or JSF, and haven't used @javax.inject.Named anywhere either. So I'm greatly relieved to learn that I'm not going to have to shove something like org.glassfish:javax.el:3.0.0 into my application after all .

             

            Cheers,

            Chris