哪个 XML 命名空间用于 JSF 2.2 及更高版本 [英] Which XML namespace to use with JSF 2.2 and up

查看:25
本文介绍了哪个 XML 命名空间用于 JSF 2.2 及更高版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我的应用程序从 JSF 1.2 迁移到 2.2.

I have migrated my application from JSF 1.2 to 2.2.

它在 java.sun.com 域上使用 XML 命名空间,例如 xmlns:f="http://java.sun.com/jsf/core".但是,Oracle 的 Java EE 7 教程xmlns.jcp.org 域上使用 XML 命名空间,例如xmlns:f="http://xmlns.jcp.org/jsf/core".

It used XML namespaces on java.sun.com domain like xmlns:f="http://java.sun.com/jsf/core". However, Oracle's Java EE 7 tutorial is using XML namespaces on xmlns.jcp.org domain like xmlns:f="http://xmlns.jcp.org/jsf/core".

推荐哪个,为什么要更改?

Which one is recommended and why was this changed?

推荐答案

推荐哪个?

继续在 xmlns.jcp.org 域上使用 XML 命名空间.这是自 2013 年 Java EE 7 以来新引入的(涵盖 a.o. JSF 2.2、Servlet 3.1、CDI 1.1 等).请注意,这不仅会影响 Facelets 文件,还会影响 XML 配置文件,例如 faces-config.xmlweb.xml,beans.xml

Go ahead with XML namespaces on xmlns.jcp.org domain. This was newly introduced since Java EE 7 in 2013 (which covers a.o. JSF 2.2, Servlet 3.1, CDI 1.1, etc). Do note that this not only affects Facelets files, but also XML configuration files such as faces-config.xml, web.xml, beans.xml, etc.

java.sun.com 上的旧 XML 命名空间仍然存在以实现向后兼容性,但这种支持最终将在未来的 Java EE 版本中消失.您应该尽快迁移您的代码库.使用普通 IDE 提供的在所有文件中查找和替换"工具应该是一项微不足道的任务.

The old XML namespaces on java.sun.com are still there for backwards compatibility, but the support will eventually disappear in a future Java EE version. You should migrate your code base as soon as you can. It should be a trivial task using "find and replace in all files" facility offered by the average IDE.

只有较旧的 Mojarra 2.2.0/2.2.1 版本存在与 XML 命名空间更改相关的错误,但这些错误不应在较新版本中出现.另见a.o.

Only older Mojarra 2.2.0 / 2.2.1 versions have had bugs related to the XML namespace changes, but those should not manifest in newer versions. See also a.o.

为什么要改变?

因为自 2010 年以来 Java 不再来自 Sun.请注意,他们很聪明,不会将它java.oracle.com 或与当前拥有的公司紧密结合的东西.它现在与 JCP(Java Community Process)很好地独立绑定,后者真正负责管理 Java (EE)规格.

Because Java is not from Sun anymore since 2010. Note that they were smart to not make it java.oracle.com or something tight coupled to the currently owning company. It's now nicely and independently tied to the JCP (Java Community Process), the one really responsible for managing the Java (EE) specifications.

这篇关于哪个 XML 命名空间用于 JSF 2.2 及更高版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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