【问题标题】:JSF ui:include on mojarra gives "One or more resources have the target of 'head', but no 'head' component has been defined within the view."JSF ui:include on mojarra 给出“一个或多个资源的目标是'head',但视图中没有定义'head'组件。”
【发布时间】:2013-06-29 19:32:15
【问题描述】:

我正在使用ui:include 在我的jsf 页面中加载一个子*.xhtml 文件。当我加载这个

<html>
  <head/>
  <body>
    Testing
  </body>
</html>

我收到此错误 一个或多个资源的目标是“头”,但视图中没有定义“头”组件。

但是 - 当我将其修改为:

<html>
  <!-- <head/> -->
  <body>
    Testing
  </body>
</html>

错误消失了。 (子 *.xhtml 文件来自静态内容团队,因此它不能包含 jsf 指令)。

根本原因是什么?如何避免这种情况?

版本:

  • Mojarra 2.0
  • Java 7.0
  • Tomcat 7.0
  • Windows 7.0

【问题讨论】:

    标签: jsf-2 facelets


    【解决方案1】:

    这是在谈论&lt;h:head&gt;。对身体做同样的事情,应该是&lt;h:body&gt;

    顺便说一句,生成的 HTML 输出必须在语法上有效。您通常不会将 &lt;html&gt; 放在 include 文件中,而只能放在父文件或主模板中。

    另见:

    【讨论】:

      猜你喜欢
      • 2015-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-03
      • 2012-12-31
      • 1970-01-01
      相关资源
      最近更新 更多