<h:head> 和有什么不一样?和<头>在 Java Facelets 中? [英] What's the difference between <h:head> and <head> in Java Facelets?

查看:28
本文介绍了<h:head> 和有什么不一样?和<头>在 Java Facelets 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参见这个.

何时以及为什么使用,而不是?

When and why to use <h:head>, instead of <head>?

我已经看到 Primefaces 不适用于 ,不过.

I've seen Primefaces won't work with <head>, though.

推荐答案

  • 标签是一个 HTML 标签,它定义了 HTML 页面的头部(这是您定义元数据的地方,或者包括诸如 JavaScript 或 CSS 之类的资源).
  • 是一个 JSF 标记(在 JSF 2.0 中引入),用于处理 部分你的页面.拥有这样的 JSF 标记的好处在于,这个头部成为 JSF 组件树的一部分,因此,您可以在 Java 代码中操作它.
    • The <head> tag is a HTML tag, which defines the head of the HTML page (this is where you define metadata, or include the resources such as JavaScript or CSS for example).
    • The <h:head> is a JSF tag (introduced with JSF 2.0) that handles the <head> part of your page. The interest of having such JSF tag is that this head becomes part of your JSF components tree, and thus, you can manipulate it in your Java code.
    • 关于 与 Primefaces 的不兼容性,我不明白为什么会发生这种情况.Facelets 在 JSF 1.x 中引入了混合 HTML 代码和 JSF (XHTML) 代码的能力,即使您在页面中插入 HTML <head> 标记也不会有任何麻烦使用 Primefaces.Facelets 与 JSF 2.x 原生集成.

      Regarding the <head> incompatibility with Primefaces, I don't see why it happens. Facelets introduced in JSF 1.x the ability to mix HTML code and JSF (XHTML) code, and you should not have any trouble to insert a HTML <head> tag in your page, even if you use Primefaces. Facelets is natively integrated with JSF 2.x.

      这篇关于&lt;h:head&gt; 和有什么不一样?和&lt;头&gt;在 Java Facelets 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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