JSF 1.2和JSF 2.x之间的JSTL xmlns名称空间差异? [英] JSTL xmlns namespace differences between JSF 1.2 and JSF 2.x?

查看:143
本文介绍了JSF 1.2和JSF 2.x之间的JSTL xmlns名称空间差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于JSF 1.2的webapp,我从中复制了JSTL导入

I have a JSF 1.2 based webapp from which I copied the JSTL import

xmlns:c="http://java.sun.com/jstl/core"

你也可以在很多地方找到这个导入互联网。我不记得以上是否在我以前的网络项目中工作,无论如何,它在我当前基于JSF 2.0的webapp中工作。我收到了来自容器的警告说:

You can also find this import in many places on the Internet. I can't remember whether the above worked in my former web project or not, in any case, it does not work in my current JSF 2.0 based webapp. I got a warning from the container saying:


警告:此页面调用XML命名空间http://java.sun.com/jstl/core 但该命名空间不存在taglibrary。

Warning: This page calls for XML namespace http://java.sun.com/jstl/core declared with prefix c but no taglibrary exists for that namespace.

然后我将导入更改为

xmlns:c="http://java.sun.com/jsp/jstl/core"

...在基于JSF / RichFaces的webapp中使用< c:forEach> 删除所有令人头疼的问题。

... which removed all headaches using <c:forEach> in a JSF/RichFaces-based webapp.

这里的诀窍是什么?从JSF 1.2到2.x的JSTL导入URL是否有任何更改?或者前一行通常是错误的(在JSF中)?这两者有什么区别?

What's the trick here? Have there been any changes to the JSTL import URL from JSF 1.2 to 2.x? Or is the former line generally wrong (in JSF)? What's the difference between the two?

推荐答案

查看我们的JSTL维基页面:https://stackoverflow.com/tags/jstl/info 无论何时悬停 jstl 标签,直到弹出一个黑框,然后点击 info 链接。

Check our JSTL wiki page: https://stackoverflow.com/tags/jstl/info You can get this kind of page whenever you hover the jstl tag below your question until a black box pops up and then click the info link.

Facelets 1.x和2.x确实为JSTL标记库使用了不同的名称空间。 Facelets 1.x中的名称空间错误越来越少,并且已针对Facelets进行修复2.x。

It is true that Facelets 1.x and 2.x uses different namespaces for the JSTL tag library. It was less or more a namespace bug in Facelets 1.x and has been fixed for Facelets 2.x.


  • 真正的JSTL 1.0 taglib使用URI http://java.sun.com/ JSTL /芯

  • 真正的JSTL 1.1 / 1.2 taglib使用URI http://java.sun.com/jsp/jstl/core

  • Facelets 1.x使用URI http://java.sun.com/jstl/core

  • Facelets 2.x使用URI http://java.sun.com/jsp/jstl/core

  • Facelets 2.2+使用URI http://xmlns.jcp.org/jsp/jstl/core

  • The real JSTL 1.0 taglib uses the URI http://java.sun.com/jstl/core.
  • The real JSTL 1.1/1.2 taglib uses the URI http://java.sun.com/jsp/jstl/core.
  • Facelets 1.x uses the URI http://java.sun.com/jstl/core.
  • Facelets 2.x uses the URI http://java.sun.com/jsp/jstl/core.
  • Facelets 2.2+ uses the URI http://xmlns.jcp.org/jsp/jstl/core.

您可以在 Facelets标记库文档。 Facelets不附带完整标记设置为真正的JSTL标记库。只复制< c:xxx> 中的一小部分以及< fn:xxx> 的完整集合进入Facelets。 < fmt:xxx> < sql:xxx> < xml :xxx> 标签不会在Facelets中被接管。

You can find all Facelets 2.x tags in the Facelets tag library documentation. Facelets don't ship with the full tag set as the real JSTL taglib. Only a few of the <c:xxx> and the full set of <fn:xxx> are copied into Facelets. The <fmt:xxx>, <sql:xxx> and <xml:xxx> tags are not taken over in Facelets.

这篇关于JSF 1.2和JSF 2.x之间的JSTL xmlns名称空间差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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