警告:此页面调用使用前缀[tagname]声明的XML名称空间,但该名称空间不存在taglibrary

时间:2011-03-03 07:44:26

标签: jsf jsf-2 facelets

我已将Facelet视图模板声明如下:

<ui:composition template="./templates/master.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.prime.com.tr/ui">

  <ui:define name="content">
    <h:panelGroup rendered="#{!current.hasLoggedIn()}">      
      <h:panelGroup layout="block" styleClass="warningBox">
        <h:outputText value="#{app.youHaveNotLoggedIn}"/>
        <br/>
        <h:link value="#{lbls.login}" outcome="login"/>
      </h:panelGroup>      
    </h:panelGroup>

    <h:panelGroup rendered="#{current.hasLoggedIn()}">
      <p:panel>
        <f:facet name="header">
          <h:outputText value="#{lbls.requestWaggon}" />
        </f:facet>

        <h:form id="frmRequest">
          <h:panelGrid columns="3" footerClass="buttons">
            <h:outputText value="#{lbls.number}:"/>
            <h:inputText id="number" label="#{lbls.number}" styleClass="ltr" value="#{requestWaggon.request.number}" readonly="true" />
            <h:message for="number" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.requestDate}:"/>
            <h:panelGroup>
              <h:inputText styleClass="date ltr" id="date" label="#{lbls.requestDate}" value="#{requestWaggon.request.date}" required="true">
                <f:converter converterId="ir.khorasancustoms.DateConverter"/>
              </h:inputText>
              <input type="button" value="..." onclick="displayDatePicker('frmRequest:date', this);" class="datePicker"/>
            </h:panelGroup>
            <h:message for="date" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.nameOfMaterialOwner}:"/>
            <h:inputText id="ownerName" label="#{lbls.nameOfMaterialOwner}" value="#{requestWaggon.request.fullName}" required="true"/>
            <h:message for="ownerName" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.companyName}:"/>
            <h:inputText id="companyName" label="#{lbls.companyName}" value="#{requestWaggon.request.companyName}" required="true"/>
            <h:message for="companyName" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.nameOfMaterial}:"/>
            <h:inputText id="nameOfMaterial" label="#{lbls.nameOfMaterial}" value="#{requestWaggon.request.materialName}" required="true"/>
            <h:message for="nameOfMaterial" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>                        

            <h:outputText value="#{lbls.materialWeight}:"/>
            <h:panelGroup>
              <h:inputText id="materialWeight" styleClass="ltr" label="#{lbls.materialWeight}" value="#{requestWaggon.request.materialWeight}" required="true" style="min-width: 0px; width: 60px"/>
              <h:selectOneMenu id="weightUnit" label="#{lbl.weightUnit}" value="#{requestWaggon.request.weightUnit}" required="true" style="min-width: 0px; width: 90px">
                <f:selectItems value="#{requestWaggon.weightUnits}"/>
                <f:converter converterId="ir.khorasancustoms.CatalogValueConverter"/>
              </h:selectOneMenu>
            </h:panelGroup>
            <h:message for="materialWeight" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.senderAddress}:"/>
            <h:inputText id="senderAddress" label="#{lbls.senderAddress}" value="#{requestWaggon.request.address}" required="true" style="width: 350px;"/>
            <h:message for="senderAddress" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.receiverAddress} (#{lbls.country}):"/>            
            <h:selectOneMenu id="country" label="#{lbl.receiverAddress}" value="#{requestWaggon.request.country}" required="true">
              <f:selectItem/>
              <f:selectItems value="#{requestWaggon.countries}"/>
              <f:converter converterId="ir.khorasancustoms.CatalogValueConverter"/>
            </h:selectOneMenu>            
            <h:message for="country" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.station}:"/>
            <h:inputText id="station" styleClass="ltr" label="#{lbls.station}" value="#{requestWaggon.request.station}" required="true" />
            <h:message for="station" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.loadingDate}:"/>
            <h:panelGroup>
              <h:inputText styleClass="date ltr" id="loadingDate" label="#{lbls.loadingDate}" value="#{requestWaggon.request.loadingDate}" required="true">
                <f:converter converterId="ir.khorasancustoms.DateConverter"/>
              </h:inputText>
              <input type="button" value="..." onclick="displayDatePicker('frmRequest:loadingDate', this);" class="datePicker"/>
            </h:panelGroup>
            <h:message for="loadingDate" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <h:outputText value="#{lbls.boundryStation}:"/>            
            <h:selectOneMenu id="boundryStation" label="#{lbl.boundryStation}" value="#{requestWaggon.request.bountryStation}" required="true">
              <f:selectItem/>
              <f:selectItems value="#{requestWaggon.boundryStations}"/>
              <f:converter converterId="ir.khorasancustoms.CatalogValueConverter"/>
            </h:selectOneMenu>            
            <h:message for="boundryStation" infoClass="info" warnClass="warning" errorClass="error" fatalClass="fatal"/>

            <f:facet name="footer">
              <h:commandButton action="#{requestWaggon.save}" value="#{lbls.ok}"/>
            </f:facet>
          </h:panelGrid>
          <h:outputScript>
            focusElement('frmRequest:ownerName');            
          </h:outputScript>
        </h:form>

        <f:facet name="footer">
          <h:messages styleClass="boxMessages" layout="table" infoClass="infoBox" warnClass="warningBox" errorClass="errorBox" fatalClass="errorBox" globalOnly="true"/>
        </f:facet>
      </p:panel>
    </h:panelGroup>
  </ui:define>
</ui:composition>

这显示以下3条警告消息:

  

警告:此页面调用使用前缀输入声明的XML命名空间,但该命名空间不存在taglibrary。

当我删除<p:panel>标记时,则不会显示这些消息。这是怎么造成的,我该如何解决?

1 个答案:

答案 0 :(得分:35)

您已声明纯HTML <input>元素,并且XML解析器以某种方式未配置为使用http://www.w3.org/1999/xhtml作为全局XML命名空间。自己添加。

<ui:composition xmlns="http://www.w3.org/1999/xhtml">