1
我想在我的項目中引入CC。我在JBoss 7.1.1上運行Java EE 6。JSF 2.0複合組件不工作
/myProj/src/main/webapp/composites/scheda.xhtml:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
<composite:attribute name="prod" />
</composite:interface>
<composite:implementation>
Hello!
</composite:implementation>
</html>
/myProj/src/main/webapp/someDir/page.xhtml:
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:composites="http://java.sun.com/jsf/composite/composites"
template="/templates/default.xhtml">
<ui:define name="content">
<p:dialog
header="Scheda"
widgetVar="schedaDialog"
id="schedaDialogId">
<composites:scheda prod="test" />
</p:dialog>
</ui:define>
</ui:composition>
結果爲:
javax.servlet.ServletException:/.../pag e.xhtml 標籤庫支持的命名空間: http://java.sun.com/jsf/composite/composites,但沒有標籤被用於名定義 :scheda
一些bug?
謝謝......但爲什麼? :) – 2013-02-18 10:04:39
那麼,這是複合組件資源的地方。閱讀[這個簡單的教程](http://www.mkyong.com/jsf2/composite-components-in-jsf-2-0/) – partlov 2013-02-18 10:06:32
我已經讀過,但錯過了這一點!我又啞又感謝! :) – 2013-02-18 10:14:48