Mojarra 和 MyFaces 之间的区别 [英] Difference between Mojarra and MyFaces

查看:30
本文介绍了Mojarra 和 MyFaces 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用 JSF2.0 我使用了一个教程作为参考,但我有以下问题:

I am starting on JSF2.0 I used a tutorial as a reference but I have the following question:

本教程仅使用了 2 个库:jsf-api.jarjsf-impl.jar(但也有来自 Mojarra 项目的 JSTL).

The tutorial used 2 libs only: jsf-api.jar, jsf-impl.jar (but also had JSTL) from Mojarra Project.

我也尝试下载它们,但似乎无法访问该站点.因此,我使用了 Apache MyFaces,但要运行该示例,我必须添加 8 个 jar(commons-*myfaces-*).
如果我使用 MyFaces,为什么我需要更多的 jars?我应该更喜欢更轻的 Mojarra 吗?此外,下载页面确实是 JSF Mojarra?

I tried to dowload them also but seems the site is not reachable. So I used Apache MyFaces but to run the example I had to add 8 jars (commons-*, myfaces-*).
Why do I need more jars if I use MyFaces? Should I prefer Mojarra as lighter? Also the download page is indeed JSF Mojarra?

谢谢

推荐答案

如果我使用 MyFaces,为什么我需要更多的 jars?

因为那些 commons-* 依赖项没有捆绑在 MyFaces 中.另一方面,如果您使用来自 Apache.org 的其他库,这些库也使用那些 commons-* 依赖项,那么您最终会得到较小的总大小库.

Because those commons-* dependencies are not bundled in MyFaces. On the other hand, if you're using other libraries from Apache.org which also use those commons-* dependencies, then you ultimately end up with smaller total size libraries.

应该注意的是,自 Mojarra 2.1.6 以来,单一 JAR 文件格式可用作 javax.faces.jar,这是因为 Mojarra 2.3.9 重命名为 jakarta.faces.jar.

Noted should be that since Mojarra 2.1.6 a single JAR file format is available as javax.faces.jar which is since Mojarra 2.3.9 renamed to jakarta.faces.jar.

我应该更喜欢更轻的 Mojarra 吗

这是一个非参数.您应该查看 JSF 实现的健壮性和良好维护性.

This is a non-argument. You should look at how robust and well maintained the JSF implementation is.

Mojarra 的祖父 Sun JSF RI 1.0 和 RI 1.1 的早期版本被讨厌的错误所困扰.那个时候(大约 2004-2006 年),MyFaces 绝对是更稳定的选择.

The grandfather of Mojarra, Sun JSF RI 1.0, and the early versions of RI 1.1 were cluttered by nasty bugs. At that moment (around 2004-2006), MyFaces was definitely the more stable alternative.

自 2006 年初左右的 1.1_02 和 1.2_02 以来,新的 Sun/Oracle JSF 开发团队做了很多工作.不仅有错误修正,还有性能增强.大约是 Mojarra 1.2 生命周期的一半(大约 2007-2009 年),Mojarra 是比 MyFaces 更好的选择.

Since 1.1_02 and 1.2_02 around early 2006 the new Sun/Oracle JSF dev team did great work. Not only with bugfixing, but also with performance enhancements. About halfway the Mojarra 1.2 lifetime (around 2007-2009), Mojarra was the better choice than MyFaces.

自从 JSF 2.0 带来了新的部分状态保存管理,MyFaces 是性能明智的更好选择,因为计算状态增量的方法不同且更有效,尤其是在使用大型组件树时.Mojarra 仅在版本 2.1.22.在 2.0/2.1 时间线期间,Mojarra 只有 <ui:repeat> 在复杂/嵌套组合中(ao 损坏状态保存,仅处理上次迭代形式,失败 <f:ajax> 等)和 flash 范围实现(初始实现完全不是防弹的).MyFaces 也有自己的一组错误,但它们是可以管理的.

Since JSF 2.0, which came with new partial state saving management, MyFaces was performance wise the better choice due to a different and much more efficient approach of calculating state deltas, particularly when using large component trees. Mojarra caught up only since version 2.1.22. During the 2.0/2.1 timeline, Mojarra had only serious issues with <ui:repeat> in complex/nested compositions (a.o. broken state saving, processing only last iterated form, failed <f:ajax>, etc) and with flash scope implementation (initial implementation was totally not bullet proof). MyFaces also had its own set of bugs, but they were manageable.

现在,对于 JSF 2.2,我们无法事先确定哪个更好.错误通常只在稍后暴露,而健壮性只能在事后评估.只需选择您感觉"的任何实现即可是最好的.浏览他们的问题报告(MyFacesMojarra) 以了解以前修复的问题和当前未解决的问题.如果您遇到特定的错误,请尝试同时使用两种实现以排除一个和另一个.如有必要,请报告以保持两个实施的整体质量较高.

Right now, with JSF 2.2, one can't really say beforehand which one is better. Bugs often expose only later and robustness can only be evaluated during the aftermath. Just pick whatever implementation you "feel" is the best. Browse through their issue reports (MyFaces and Mojarra) to learn about the previously fixed issues and the currently open issues. If you encounter a specific bug, try with both implementations to exclude the one and other. Report if necessary to keep the overall quality of the both implementations high.

还有下载页面确实是JSF Mojarra?

他们的主页已经移动了好几次.目前(2019 年 11 月)它位于 https://eclipse-ee4j.github.io/mojarra.您可以在 org.glassfish:jakarta 中找到这些库.面部也在Maven Central中.你可以在eclipse-ee4j/mojarra GitHub 项目中找到源代码.

Their homepage has been moved around several times. Currently (Nov 2019) it's located at https://eclipse-ee4j.github.io/mojarra. You can find the libraries in org.glassfish:jakarta.faces in Maven Central too. You can find the source code in eclipse-ee4j/mojarra project in GitHub.

这篇关于Mojarra 和 MyFaces 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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