我編寫了下面的代碼並將其另存爲一個單獨的文件。複合組件內無法使用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標籤嗎?
請注意,它一直工作,這些只是XML解析器警告,沒有錯誤。當JSF項目階段未設置爲「Development」時,它們不會顯示。它們也不會與某些XML解析器結合使用(請閱讀:某些appservers)。 – BalusC 2011-03-30 11:32:38