本文介绍了警告:此页面需要使用前缀[tagname]声明的XML名称空间,但该名称空间不存在标签库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我已经声明了Facelet视图模板,如下所示:

I've declared the Facelet view template as follows:

<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条警告消息:

This shows 3 of the following warning messages:

当我删除<p:panel>标记时,那些消息不会出现.这是怎么引起的,我该如何解决?

When I remove the <p:panel> tag, then those messages do not appear. How is this caused and how can I solve it?

推荐答案

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

You've declared plain HTML <input> elements and the XML parser is somehow not been configured to use http://www.w3.org/1999/xhtml as global XML namespace. Add it yourself.

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

这篇关于警告:此页面需要使用前缀[tagname]声明的XML名称空间,但该名称空间不存在标签库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 01:34