TomEE1.7.x建议使用的JSF依赖项是什么? [英] What are the recommended JSF dependencies with TomEE1.7.x?

查看:101
本文介绍了TomEE1.7.x建议使用的JSF依赖项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在TomEE 1.7.3(基于JavaEE6)上开发JSF2.0(我不太确定JSF版本)应用程序.

I've been developing a JSF2.0 (I'm not really sure about the JSF version) application on TomEE 1.7.3 (JavaEE6 based).

在我的Maven pom.xml中,我有太多依赖关系,我已经从许多示例中复制了这些依赖关系,但是我将它们降低到最低要求.波纹管是我pom.xml的依赖项"部分:

In my Maven pom.xml, I had too many dependencies which I've copied from many examples, but I reduced them to minimum requirements. Bellow is the "dependencies" part of my pom.xml:

<dependencies>
    <!-- JavaEE6 -->
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>6.0</version>
    </dependency>
    <!-- /JavaEE6 -->

    <!-- OmniFaces for JSF, @Eager, postback same request parameters, etc. -->
    <dependency>
        <groupId>org.omnifaces</groupId>
        <artifactId>omnifaces</artifactId>
        <version>1.8.3</version>
    </dependency>
    <!-- /OmniFaces -->

    <!-- glassfish faces (is it called mojarra??) -->
    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>2.2.12</version>
        <scope>runtime</scope>
    </dependency>
    <!-- /glassfish faces -->

    <!-- some mysql connector -->
    <!-- some aws sdks, s3, ec2, etc -->
    <!-- some apache commons, StringUtils. etc -->
    <!-- some apache velocity -->
</dependencies>

org.glassfish#javax.faces#2.2.12依赖项也可以删除, 但这会导致html布局问题(使用引导CSS). 将其降级到版本2.0.x,会导致相同的布局问题. 我知道我可以修复它,但是要花几个小时.

The org.glassfish#javax.faces#2.2.12 dependency can be removed as well, but it causes html layout problem (with the bootstrap css). Downgrading it to version 2.0.x, causes the same layout problem. I know I can fix it, but it takes couple of hours.

我想问的是:

  1. 在TomEE1.7.x中使用Glassfish面孔 2.2.x 是个好主意还是坏主意? TomEE的描述说它仅支持JSF 2.0,但是到目前为止,它几乎可以正常工作(我遇到的问题很少,但似乎与该版本无关).
  2. 删除玻璃鱼的面部依赖并使用默认的MyFaces更好吗?
  3. 就我而言,如果我选择glassfish服务器而不是TomEE会更好吗?
  1. Is it good or bad idea to use glassfish faces 2.2.x within TomEE1.7.x? TomEE's description says that it only supports up to JSF 2.0, but so far, it is working almost fine (I have few problems but those do not seem relevant to this version).
  2. Is it better to remove glassfish faces dependency and use the default MyFaces instead?
  3. Is it even better if I choose glassfish server, instead of TomEE, in my case?

顺便说一句,我昨天又问了一个问题: JSF2.0某些facesmessages没有发送到有关错误处理的重定向页面

BTW, I asked another question yesterday: JSF2.0 Some facesmessages not sent to redirected page on error handling

并且我认识到我必须先清理我的项目,这样可能有助于减少我的问题.

and I recognized that I have to clean up my project first, so it might help reduce my problems.

谢谢.

推荐答案

您已经说过,TomEE是Java EE 6容器(而不是像Tomcat这样的准系统JSP/Servlet容器).因此,它已经(几乎)提供了Java EE 6 provided的所有功能,包括JSF 2.0/2.1.几乎是因为它实际上是一个Java EE Web配置文件容器.因此,您实际上应该使用javaee-web-api工件ID.

As you already said yourself, TomEE is a Java EE 6 container (and not a barebones JSP/Servlet container like Tomcat). So it has already (nearly) everything from Java EE 6 provided out the box, including JSF 2.0/2.1. Nearly, because it's actually a Java EE web profile container. So you should actually use javaee-web-api artifact ID.

仅这应足够:

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-web-api</artifactId>
    <version>6.0</version>
    <scope>provided</scope>
</dependency>

作为Apache产品,其捆绑的JSF实现实际上是MyFaces,而不是Mojarra.

As an Apache product, its bundled JSF implementation is actually MyFaces, not Mojarra.

如果您打算使用Java EE 7的一部分JSF 2.2,则应该改用TomEE 7,并在pom中更改版本.

In case you intend to use JSF 2.2, which is part of Java EE 7, you should be using TomEE 7 instead and change the version in pom.

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-web-api</artifactId>
    <version>7.0</version>
    <scope>provided</scope>
</dependency>

一个里程碑已于本月发布,请参见下载页面. TomEE 7的替代版本是 WildFly 8+或 Payara 4 +.

A milestone was released just this month, see the downloads page. Alternatives to TomEE 7 are WildFly 8+ or Payara 4+.

  • Our JSF wiki page - also contains JSF installation instructions and Maven coordinates (and many more useful information to get started).

这篇关于TomEE1.7.x建议使用的JSF依赖项是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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