Eclipse 元素“p:dataTable”的类型后面必须跟有以下属性规范之一“>”或“/>”

Eclipse 元素“p:dataTable”的类型后面必须跟有以下属性规范之一“>”或“/>”,eclipse,jsf,jsf-2,primefaces,Eclipse,Jsf,Jsf 2,Primefaces,好吧,简单地说…问题是当我尝试使用primefaces运行我的jsf项目时,它没有..并且在浏览器上弹出一个错误屏幕,上面写着什么 Estado HTTP 500-错误解析/Lista.xhtml:Error tracked[line:37]El tipo de elemento p:dataTable debe ir seguido de una de estas specificiaciones de atributo:>o/> HTTP Status 500-/Lista.xhtml解析错

好吧,简单地说…问题是当我尝试使用primefaces运行我的jsf项目时,它没有..并且在浏览器上弹出一个错误屏幕,上面写着什么

Estado HTTP 500-错误解析/Lista.xhtml:Error tracked[line:37]El tipo de elemento p:dataTable debe ir seguido de una de estas specificiaciones de atributo:>o/>

HTTP Status 500-/Lista.xhtml解析错误:错误跟踪[第37行]元素p:dataTable的类型后面必须跟有以下属性规范之一>或/>

嗯,我尝试了任何东西,甚至是干净的,验证和仔细查看每一个代码行,所以…请帮助我会很高兴你的帮助

这是我的密码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"

    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">

<ui:composition template="Template.xhtml">
<ui:define name="content">
<h:head>
<title>Welcome</title>
</h:head>
<h:body>
<h:form>

<p:panelGrid style="margin: 0 auto" columns="2">
<p:outputLabel value="Nombres" />
<p:inputText p:placeholder="Ej; Edward" value="#{personaBean.persona.nombre}"></p:inputText>
<p:outputLabel value="Apellidos" />
<p:inputText p:placeholder="Ej; Snowden"
value="#{personaBean.persona.apellido}" />

<p:outputLabel value="Sexo" style="center" />
<p:selectOneMenu value="#{personaBean.persona.sexo}">
<f:selectItem itemValue="Masculino." itemLabel="Masculino." />
<f:selectItem itemValue="Femenino." itemLabel="Femenino." />
</p:selectOneMenu>

<p:commandButton value="Enviar" actionListener="#{personaBean.agregamePersona}" update="dt" ></p:commandButton>
</p:panelGrid>
<!-- <p:growl id="msj" showDetail="true"/> -->

<p:dataTable id="dt" 
value="#{personaBean.lstPersonas}" 
border="1"var="p" rows="4" 
paginator="true"
paginatorTemplate="{CurrentPageReport}
       {FirstPageLink}
       {PreviousPageLink}
       {PageLinks}
       {NextPageLink}
       {LastPageLink}
       {Exporters}" 
tableStyle="widh:auto" 
rowsPerPageTemplate="1,2,3,5" >

<p:column filterBy="#{p.nombre}" filterMatchMode="contains"headerText="Nombre" style="width:100px" >
<h:outputText value="#{p.nombre}" />
</p:column>
<p:column headerText="Apellido" filterBy="#{p.apellido}" filterMatchMode="contains"style="width:100px">
<h:outputText value="#{p.apellido}" />
</p:column>
<p:column headerText="Sexo" filterBy="#{p.sexo}" filterMatchMode="contains"style="width:100px" sortBy="#{p.sexo}">
<h:outputText value="#{p.sexo}" />
</p:column>

<p:column style="width:40px">
<h:panelGrid columns="3" styleClass="Actions" cellpadding="2">
<p:commandButton id="eraseButton" value="Eliminar"actionListener="#{personaBean.eliminamePersona(p)}" update="dt"  />

<p:commandButton id="selectButton" update=":form:display" oncomplete="interactiveDialog.show()" icon="ui-icon-search" title="View">
<f:setPropertyActionListener value="#{p}" target="#{personaBean.persona}" />
</p:commandButton>

</h:panelGrid>
</p:column>

</p:dataTable>

<p:dialog header="Detalle del cliente" widgetVar="interactiveDialog" resizable="false" id="dialogointeractivo"
          showEffect="fade" hideEffect="explode" modal="true">

<h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">

<f:facet name="header">
<h:outputText value="Datos de la fila seleccionada"/>
</f:facet>
<h:outputText value="Nombre"/>
<h:outputText value="#{personaBean.persona.nombre}" style="font-weight:bold"/>

<h:outputText value="Apellido"/>
<h:outputText value="#{personaBean.persona.apellido}" style="font-weight:bold"/>

<h:outputText value="Sexo"/>
<h:outputText value="#{personaBean.persona.sexo}" style="font-weight:bold"/>


</h:panelGrid>


</p:dialog> 

</h:form>
</h:body>
</ui:define>
</ui:composition>
</html>

您应该在属性边框和var之间留出一个空格:border=1var=p。这很好@Omar。引号应该足以划分属性。OP应该在文档上运行一个XML验证器。根据您的IDE,您应该能够右键单击文档并选择validate或类似的东西。最后我解决了它只是..比如说评论。然后一个接一个地重写所有的标记,是的,科洛索斯,我尝试了eclipse的验证和项目清理,但是没有成功。谢谢你的回复