John John
John John

Reputation: 4575

JSF 2 in Appengine - EL Expressions

I'm trying to run JSF on Google AppEngine, it was running smoothly till I need to use some expression languages in the XHTML page.

   <li class="#{cc.attrs.currentPage == 'gerar' ? 'active' : ''}">

I tried a lot of different configurations. Locally on AppEngine SDK server it works perfectly, but in production the page does not open.

Anyone has a project with this environment and characteristics? What is the right maven dependencies to run EL expressions?

Appegine target version: 1.9.4

        <!--JSF-->
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
            <version>1.1</version>
        </dependency>
       <!-- What is the javax.el implementation I need to use in AppEngine? -->

Upvotes: 0

Views: 359

Answers (1)

Daniel
Daniel

Reputation: 37061

Try using the following

<context-param>
      <param-name>com.sun.faces.expressionFactory</param-name>
      <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>

and grab the jar from here jboss-seam-2.2.2.Final.zip

Read more in the following issue Inability to use EL API 2.2

Edited:

IF you are using MyFaces 2.2.2, in web.xml:

<context-param>
    <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
    <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>

And, if you are using maven you can get the compatible libs directly from jboss repository:

<dependency>
    <groupId>javax.el</groupId>
    <artifactId>el-api</artifactId>
    <version>2.2</version>
</dependency>
<dependency>
    <groupId>org.jboss.el</groupId>
    <artifactId>jboss-el</artifactId>
    <version>1.0_02.CR6</version>
</dependency>
...
<repositories>
      <repository>
          <id>jboss</id>
          <name>Jboss Maven Repository</name>
          <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
      </repository>
</repositories>

Upvotes: 1

Related Questions