Appengine中的JSF 2-EL表达式 [英] JSF 2 in Appengine - EL Expressions

查看:84
本文介绍了Appengine中的JSF 2-EL表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Google AppEngine上运行JSF,直到我需要在XHTML页面中使用某些表达式语言为止,它运行都很平稳。

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' : ''}">

我尝试了很多不同的配置。在AppEngine SDK服务器上本地运行良好,但在生产中该页面无法打开。

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

任何人都有一个具有这种环境和特征的项目吗?什么是运行EL表达式的正确Maven依赖项?

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

目标对象版本: 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? -->


推荐答案

尝试使用以下

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

然后从此处 jboss-seam-2.2.2.Final.zip

阅读以下问题的更多信息无法使用EL API 2.2

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

已编辑:

如果您在web.xml中使用MyFaces 2.2.2,则:

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>

而且,如果您使用的是maven,则可以直接从jboss存储库获取兼容的库:

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>

这篇关于Appengine中的JSF 2-EL表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆