Jsf 2 JSF2:标记库支持命名空间:http://java.sun.com/jsf/composite/components/customer,但没有为name:list定义标记

Jsf 2 JSF2:标记库支持命名空间:http://java.sun.com/jsf/composite/components/customer,但没有为name:list定义标记,jsf-2,mojarra,Jsf 2,Mojarra,我为客户列表创建了一个复合组件。我可以在视图中使用此组件: <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:c

我为客户列表创建了一个复合组件。我可以在视图中使用此组件:

<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>

我在Mojarra Jira上找到了解决此问题的方法:

我放置了
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">

根据Jira的说法,这个问题在Mojarra 2.1.10中已经修复,所以我希望JBoss很快更新为7.1…:)

eclipse查看的文件夹路径(组件)不正确

从生成路径中删除src/main/resource——生成路径==>从生成路径中删除。
并在构建路径中再次添加

<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)
<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">