【问题标题】:unable to use div tag inside composite components无法在复合组件中使用 div 标签
【发布时间】:2011-07-25 19:27:47
【问题描述】:

我编写了以下代码并将其保存为单独的文件。

<!DOCTYPE html>
<ui:composition
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    <div id="crb_header">
     <br/>
     <h4 align="right">Welcome : #{homebean.user}</h4>
     <br/>
    </div>
</ui:composition>

以上页面使用ui:include附加到主页,并且在主页末尾可以看到以下警告消息。

Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix h4 but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix br but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix br but no taglibrary exists for that namespace. 

我们不能在 ui:composition 文件中使用 html 标签吗?

【问题讨论】:

  • 请注意,它一直有效,而且这些只是 XML 解析器警告,没有错误。当 JSF 项目阶段未设置为 Development 时,它们不会出现。它们也不会与某些 XML 解析器(阅读:某些应用服务器)一起出现。

标签: java netbeans jsf-2 facelets


【解决方案1】:

您没有错过在 ui:composition 中包含 xhtml 命名空间吗?

<ui:composition
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets">

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-01-05
  • 2017-01-14
  • 2011-12-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多