组件ID j_id?:已在视图中找到名称.

sam*_*ira 2 java jsf tomcat java-ee jsf-2

我的项目中有HTTP Status 500错误.我正在使用jsf spring和hibernate的集成.我不知道解决这个问题.我已经添加了必要的jar文件.错误是:

description The server encountered an internal error () that prevented it from fulfilling this request.
exception: javax.servlet.ServletException: Component ID j_idt4:name has already been found in the view.  
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)
Run Code Online (Sandbox Code Playgroud)

追踪是:

</head>
<body>
<h1>????? ???? ????? ????</h1>

  +id: j_idt4
   type: javax.faces.component.html.HtmlForm@1810af25
    +id: j_idt5
     type: javax.faces.component.html.HtmlPanelGrid@cc4dacd
      +id: j_idt6
       type: 
              ????? ?????? : 

      +id: name
       type: javax.faces.component.html.HtmlInputText@6f5ab27a
Run Code Online (Sandbox Code Playgroud)

personel.xhtml

<?xml version="1.0" encoding="utf-8" ?>
<!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:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>??????? ??????</title>
</head>
<body>
<h1>????? ???? ????? ????</h1>
        <h:form>

            <h:panelGrid columns="6" dir="rtl">
              ????? ?????? : 
                <h:inputText id="name" value="#{personelMB.personel_id}" 
                    size="20" required="true"
                    label="id" >
                </h:inputText>
                ??? : 
                <h:inputText id="name" value="#{personelMB.pname}" 
                    size="20" required="true"
                    label="Name" >
                </h:inputText>

                 ??? ????????: 
                <h:inputText id="family" value="#{personelMB.pfamily}" 
                    size="20" required="true"
                    label="family" >
                </h:inputText> 

                ???? : 
                <h:inputTextarea id="address" value="#{personelMB.paddress}" 
                    cols="30" rows="10" required="true"
                    label="Address" >
                </h:inputTextarea>


          ????:  
                <h:inputText id="tel" value="#{personelMB.pphone}" 
                    size="20" required="true"
                    label="tel" >
                </h:inputText> 
            </h:panelGrid>

            <h:commandButton value="??? ???????" action="#{personelMB.addPersonel()}" />

        </h:form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

请帮我.

mth*_*ers 5

你有两个出现次数<h:inputTextid="name".这些id应该在作为命名容器的最近的父组件(例如数据表组件或表单)中是唯一的.