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

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

问题描述

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

I have migrated my application from JSF 1.2 to 2.2.

它在java.sun.com域(如xmlns:f="http://java.sun.com/jsf/core")上使用了XML名称空间.但是, 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.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名称空间更改相关的错误,但这些错误不应在较新的版本中体现.另请参见.

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.

  • Using new xmlns.jcp.org namespace on composites causes java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putIfAbsent
  • f:viewParam doesn't pass required parameter when new xmlns.jcp.org namespace is used
  • The metadata component needs to be nested within a f:metadata tag. Suggestion: enclose the necessary components within <f:metadata>

为什么要更改?

因为Java自2010年以来就不再使用Java.请注意,他们很聪明地不采用Java,或者与当前拥有的公司紧密相关.现在,它与JCP( Java社区流程)完美独立地联系在一起,它是真正负责管理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.

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

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