我编写了以下代码并将其另存为单独的文件。
<!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标签吗?
答案 0 :(得分:4)
您是不是错过了在ui:composition
?
<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">