users@glassfish.java.net

Duplicated entrie in JSP

From: <glassfish_at_javadesktop.org>
Date: Fri, 27 Jul 2007 05:28:30 PDT

Hi I have short problem:
I have a list which I include <c:import url="include/spielplatzliste.jsp" />, every thing is fine.
But now I but this into several panel grids, and if I now execute the page I get an error:

I tried to put the included page into <f:subview>.
Please help:

[CODE]
<%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Spielplatz Info</title>
<link rel="stylesheet" type="text/css"
        href="<%= request.getContextPath() %>/stylesheet.css" />
</head>
<body>
<f:view>
        <c:import url="include/header.jsp" />
        <%-- Content --%>
        <h:panelGrid columns="3" id="content">
                <%-- Left --%>
                <h:panelGrid id="left">
                        <c:import url="include/search.jsp" />
                </h:panelGrid>
                <%-- Center --%>
                <h:panelGrid id="center">
                        <c:import url="include/spielplatzliste.jsp" />
                </h:panelGrid>
                <%-- Right --%>
                <h:panelGrid id="right">
                        <h:outputText value="right"></h:outputText>
                </h:panelGrid>
        </h:panelGrid>
        
</f:view>
</body>
</html>
[CODE]
Included Page:
[CODE]
<%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<<f:subview id="liste">
<h:form id="searchliste">
        <h:dataTable id="table" value="#{spielplatzliste.all}" rowClasses="table-odd-row, table-even-row" var="item">
            <h:column>
                    <f:facet name="header">
                                <h:outputText value="typ" />
                        </f:facet>
                        <h:graphicImage url="/icons/spielplatz.gif"></h:graphicImage>
            </h:column>
                <h:column>
                        <f:facet name="header">
                                <h:outputText value="id" />
                        </f:facet>
                        <h:outputText value="#{item.id}" />
                </h:column>
                <h:column>
                        <f:facet name="header">
                                <h:outputText value="name" />
                        </f:facet>
                        <h:outputText value="#{item.name}" />
                </h:column>
        </h:dataTable>
</h:form>
</f:subview>
[/CODE]

[CODE]
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Component ID 'liste' has already been used in the view.
See below for the view up to the point of the detected error.
+id: j_id_id18
 type: javax.faces.component.UIViewRoot_at_b05b39
  +id: j_id0
   type: javax.faces.component.html.HtmlOutputText_at_3505cb
  +id: content
   type: javax.faces.component.html.HtmlPanelGrid_at_10f766f
    +id: left
     type: javax.faces.component.html.HtmlPanelGrid_at_2893ce
      +id: searchForm
       type: javax.faces.component.html.HtmlForm_at_1ffd008
        +id: j_id_id9j_id_1
         type: javax.faces.component.html.HtmlPanelGrid_at_1b2cb94
          +id: sucheButton
           type: javax.faces.component.html.HtmlCommandButton_at_1537e1d
          +id: j_id_id14j_id_1
           type: javax.faces.component.html.HtmlOutputText_at_7cc058
          +id: staatLabel
           type: javax.faces.component.html.HtmlOutputLabel_at_3805f9
            +id: j_id1
             type: javax.faces.component.html.HtmlOutputText_at_1022a6
          +id: staat
           type: javax.faces.component.html.HtmlSelectOneListbox_at_152cb9a
            +id: j_id_id22j_id_1
             type: javax.faces.component.UISelectItems_at_b52bbd
          +id: landLabel
           type: javax.faces.component.html.HtmlOutputLabel_at_4aa98f
            +id: j_id2
             type: javax.faces.component.html.HtmlOutputText_at_1c1fbd9
          +id: land
           type: javax.faces.component.html.HtmlSelectOneListbox_at_7d6683
            +id: j_id_id30j_id_1
             type: javax.faces.component.UISelectItem_at_d523bb
            +id: j_id_id32j_id_1
             type: javax.faces.component.UISelectItems_at_11d06f0
          +id: bezirkLabel
           type: javax.faces.component.html.HtmlOutputLabel_at_b28892
            +id: j_id3
             type: javax.faces.component.html.HtmlOutputText_at_1244d80
          +id: bezirk
           type: javax.faces.component.html.HtmlSelectOneListbox_at_5c498e
            +id: j_id_id40j_id_1
             type: javax.faces.component.UISelectItem_at_e134e6
            +id: j_id_id42j_id_1
             type: javax.faces.component.UISelectItems_at_1582503
          +id: gemeindeLabel
           type: javax.faces.component.html.HtmlOutputLabel_at_1e60665
            +id: j_id4
             type: javax.faces.component.html.HtmlOutputText_at_addd24
          +id: gemeinde
           type: javax.faces.component.html.HtmlSelectOneListbox_at_91a775
            +id: j_id_id50j_id_1
             type: javax.faces.component.UISelectItem_at_89178b
            +id: j_id_id52j_id_1
             type: javax.faces.component.UISelectItems_at_68d102
      +id: j_id5
       type: javax.faces.component.html.HtmlOutputText_at_171ee01
      +id: suchstringStaat
       type: javax.faces.component.html.HtmlOutputText_at_c099ef
      +id: j_id6
       type: javax.faces.component.html.HtmlOutputText_at_ba3d2c
      +id: suchstringLand
       type: javax.faces.component.html.HtmlOutputText_at_10634e7
      +id: j_id7
       type: javax.faces.component.html.HtmlOutputText_at_7b2b3e
      +id: suchstringBezirk
       type: javax.faces.component.html.HtmlOutputText_at_53f9d8
      +id: j_id8
       type: javax.faces.component.html.HtmlOutputText_at_1380a71
      +id: suchstringGemeinde
       type: javax.faces.component.html.HtmlOutputText_at_3598ef
    +id: center
     type: javax.faces.component.html.HtmlPanelGroup_at_cb771e

root cause

javax.servlet.jsp.JspException: Component ID 'liste' has already been used in the view.
See below for the view up to the point of the detected error.
+id: j_id_id18
 type: javax.faces.component.UIViewRoot_at_b05b39
  +id: j_id0
   type: javax.faces.component.html.HtmlOutputText_at_3505cb
  +id: content
   type: javax.faces.component.html.HtmlPanelGrid_at_10f766f
    +id: left
     type: javax.faces.component.html.HtmlPanelGrid_at_2893ce
      +id: searchForm
       type: javax.faces.component.html.HtmlForm_at_1ffd008
        +id: j_id_id9j_id_1
         type: javax.faces.component.html.HtmlPanelGrid_at_1b2cb94
          +id: sucheButton
           type: javax.faces.component.html.HtmlCommandButton_at_1537e1d
          +id: j_id_id14j_id_1
           type: javax.faces.component.html.HtmlOutputText_at_7cc058
          +id: staatLabel
           type: javax.faces.component.html.HtmlOutputLabel_at_3805f9
            +id: j_id1
             type: javax.faces.component.html.HtmlOutputText_at_1022a6
          +id: staat
           type: javax.faces.component.html.HtmlSelectOneListbox_at_152cb9a
            +id: j_id_id22j_id_1
             type: javax.faces.component.UISelectItems_at_b52bbd
          +id: landLabel
           type: javax.faces.component.html.HtmlOutputLabel_at_4aa98f
            +id: j_id2
             type: javax.faces.component.html.HtmlOutputText_at_1c1fbd9
          +id: land
           type: javax.faces.component.html.HtmlSelectOneListbox_at_7d6683
            +id: j_id_id30j_id_1
             type: javax.faces.component.UISelectItem_at_d523bb
            +id: j_id_id32j_id_1
             type: javax.faces.component.UISelectItems_at_11d06f0
          +id: bezirkLabel
           type: javax.faces.component.html.HtmlOutputLabel_at_b28892
            +id: j_id3
             type: javax.faces.component.html.HtmlOutputText_at_1244d80
          +id: bezirk
           type: javax.faces.component.html.HtmlSelectOneListbox_at_5c498e
            +id: j_id_id40j_id_1
             type: javax.faces.component.UISelectItem_at_e134e6
            +id: j_id_id42j_id_1
             type: javax.faces.component.UISelectItems_at_1582503
          +id: gemeindeLabel
           type: javax.faces.component.html.HtmlOutputLabel_at_1e60665
            +id: j_id4
             type: javax.faces.component.html.HtmlOutputText_at_addd24
          +id: gemeinde
           type: javax.faces.component.html.HtmlSelectOneListbox_at_91a775
            +id: j_id_id50j_id_1
             type: javax.faces.component.UISelectItem_at_89178b
            +id: j_id_id52j_id_1
             type: javax.faces.component.UISelectItems_at_68d102
      +id: j_id5
       type: javax.faces.component.html.HtmlOutputText_at_171ee01
      +id: suchstringStaat
       type: javax.faces.component.html.HtmlOutputText_at_c099ef
      +id: j_id6
       type: javax.faces.component.html.HtmlOutputText_at_ba3d2c
      +id: suchstringLand
       type: javax.faces.component.html.HtmlOutputText_at_10634e7
      +id: j_id7
       type: javax.faces.component.html.HtmlOutputText_at_7b2b3e
      +id: suchstringBezirk
       type: javax.faces.component.html.HtmlOutputText_at_53f9d8
      +id: j_id8
       type: javax.faces.component.html.HtmlOutputText_at_1380a71
      +id: suchstringGemeinde
       type: javax.faces.component.html.HtmlOutputText_at_3598ef
    +id: center
     type: javax.faces.component.html.HtmlPanelGroup_at_cb771e

note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server Platform Edition 9.0_01 logs.
Sun Java System Application Server Platform Edition 9.0_01
[/CODE]
[Message sent by forum member 'chris_lenz' (chris_lenz)]

http://forums.java.net/jive/thread.jspa?messageID=228510