无法在复合组件内使用 div 标签
我编写了以下代码并将其保存为单独的文件。
<!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 标签吗?
I wrote the following code and save it as a separate file.
<!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>
The above page is attached to the main page usingui:include
and the following warning messages are visible at the end of the main page.
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.
Can't we use html tags inside this ui:composition
files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否错过了将 xhtml 命名空间包含在
ui:composition
中?Didn't you miss to include the xhtml namespace inside the
ui:composition
?