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

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

问题描述

请参见

何时以及为何使用<h:head>而不是<head>?

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

不过,我已经看到Primefaces无法与<head>一起使用.

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

推荐答案

  • <head>标签是 HTML 标签,用于定义标题HTML页面(您可以在其中定义元数据,或包含JavaScript或CSS之类的资源).
  • <h:head> JSF 标记(JSF 2.0引入),用于处理页面的<head>部分.拥有这样的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.
    • 关于<head>与Primefaces的不兼容,我不知道为什么会发生. JSF 1.x中引入的Facelets具有混合HTML代码和JSF(XHTML)代码的功能,即使您使用Primefaces,在页面中插入HTML <head>标记也不会有任何麻烦. 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; head&gt;在Java Facelets中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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