2012-09-16 25 views
1

我爲客戶列表創建了一個複合組件。我可以在一個視圖中使用這個組件:JSF2:標籤庫支持名稱空間:http://java.sun.com/jsf/composite/components/customer,但沒有爲標籤定義名稱:列表

<html 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" 
    xmlns:p="http://primefaces.org/ui" 
    xmlns:customer="http://java.sun.com/jsf/composite/components/customer"> 

<ui:composition template="/WEB-INF/templates/template.xhtml"> 

    <ui:define name="caption"> 
    <h:outputText value="#{msg.customerListHeading}" /> 
    </ui:define> 

    <ui:define name="content"> 

    <ui:decorate template="/WEB-INF/templates/sidebox.xhtml"> 
     <ui:param name="title" value="#{msg.customerListHeading}" /> 

     <p:outputPanel> 
     <h:form id="customerList"> 

      <customer:list list="#{customerControllerBean.list}"> 
      <f:facet name="headerButton"> 
       <h:button outcome="customerdetail.jsf" 
       value="#{msg.newButtonLabel}" /> 
      </f:facet> 
      <f:facet name="rowButton"> 
       <h:commandButton value="#{msg.deleteButtonLabel}" 
       action="#{customerControllerBean.delete(customer)}" /> 
       <h:button outcome="customerdetail.jsf?id=#{customer.id}" 
       value="#{msg.editButtonLabel}" /> 
      </f:facet> 
      </customer:list> 

     </h:form> 
     </p:outputPanel> 
    </ui:decorate> 

    </ui:define> 

</ui:composition> 

</html> 

但是當我使用的組件在一個非常類似的觀點,我收到以下錯誤:

<customer:list> Tag Library supports namespace: http://java.sun.com/jsf/composite/components/customer, but no tag was defined for name: list 

有問題的看法如下所示:

<html 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" 
    xmlns:p="http://primefaces.org/ui" 
    xmlns:customer="http://java.sun.com/jsf/composite/components/customer"> 

<ui:composition template="/WEB-INF/templates/template.xhtml"> 

    <ui:define name="caption"> 
    <h:outputText value="#{msg.customerListHeading}" /> 
    </ui:define> 

    <ui:define name="content"> 

    <ui:decorate template="/WEB-INF/templates/sidebox.xhtml"> 
     <ui:param name="title" value="#{msg.customerListHeading}" /> 

     <p:outputPanel> 
     <h:form id="customerList"> 

      <customer:list list="#{customerControllerBean.list}"> 
      <f:facet name="rowButton"> 
       <h:commandButton value="#{msg.applyButtonLabel}" 
       action="#{orderControllerBean.setCustomer(customer)}" /> 
      </f:facet> 
      </customer:list> 

     </h:form> 
     </p:outputPanel> 
    </ui:decorate> 

    </ui:define> 

</ui:composition> 

</html> 

正如你所看到的,這兩個視圖只有當我在兩個不同的上下文中使用列表時,我用來將按鈕添加到客戶列表中的方面不同。但爲什麼第二種看法不起作用?

我發現有/與鑽嘴魚科的一個問題,但我用關於這個問題的所謂的穩定版本:

2012-09-16 19:09:41,512 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Mojarra 2.1.7-jbossorg-1 (20120227-1401) 

回答

4

我發現了一個變通方法上鑽嘴魚科吉拉這個問題: http://java.net/jira/browse/JAVASERVERFACES-2437

我置於xmlns:customer="http://java.sun.com/jsf/composite/components/customer"ui:composition標籤和視圖成功地呈現:

<html 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" 
    xmlns:p="http://primefaces.org/ui" 
    xmlns:customer="http://java.sun.com/jsf/composite/components/customer"> 

<ui:composition template="/WEB-INF/templates/template.xhtml" xmlns:customer="http://java.sun.com/jsf/composite/components/customer"> 

    <ui:define name="caption"> 
    <h:outputText value="#{msg.customerListHeading}" /> 
    </ui:define> 

    <ui:define name="content"> 

...

根據該吉拉的問題是固定在鑽嘴魚科2.1.10,所以我希望的JBoss AS更新快7.1 ... :)

-1

不正確的文件夾路徑(組件)由觀看日食

從構建路徑中刪除src/main/resource - 構建路徑==>從構建路徑中刪除。
並在構建路徑中再次添加

相關問題