Skip to main content

Duplicated entrie in JSP

4 replies [Last post]
chris_lenz
Offline
Joined: 2004-07-02

Hi I have short problem:
I have a list which I include , 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 .
Please help:

<br />
<%@ page language="java" contentType="text/html; charset=UTF-8"<br />
	pageEncoding="UTF-8"%><br />
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%><br />
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%><br />
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%></p>
<p>Spielplatz Info<br />
/stylesheet.css" /></p>
<p>	<%-- Content --%></p>
<p>		<%-- Left --%></p>
<p>		<%-- Center --%></p>
<p>		<%-- Right --%></p>
<p>[CODE]<br />
Included Page:<br />
[CODE]<br />
<%@ page language="java" contentType="text/html; charset=UTF-8"<br />
	pageEncoding="UTF-8"%><br />
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%><br />
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%><br />
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%><br />
<</p>
<p>

<br />
type Exception report</p>
<p>message</p>
<p>description The server encountered an internal error () that prevented it from fulfilling this request.</p>
<p>exception</p>
<p>javax.servlet.ServletException: Component ID 'liste' has already been used in the view.<br />
See below for the view up to the point of the detected error.<br />
+id: j_id_id18<br />
 type: javax.faces.component.UIViewRoot@b05b39<br />
  +id: j_id0<br />
   type: javax.faces.component.html.HtmlOutputText@3505cb<br />
  +id: content<br />
   type: javax.faces.component.html.HtmlPanelGrid@10f766f<br />
    +id: left<br />
     type: javax.faces.component.html.HtmlPanelGrid@2893ce<br />
      +id: searchForm<br />
       type: javax.faces.component.html.HtmlForm@1ffd008<br />
        +id: j_id_id9j_id_1<br />
         type: javax.faces.component.html.HtmlPanelGrid@1b2cb94<br />
          +id: sucheButton<br />
           type: javax.faces.component.html.HtmlCommandButton@1537e1d<br />
          +id: j_id_id14j_id_1<br />
           type: javax.faces.component.html.HtmlOutputText@7cc058<br />
          +id: staatLabel<br />
           type: javax.faces.component.html.HtmlOutputLabel@3805f9<br />
            +id: j_id1<br />
             type: javax.faces.component.html.HtmlOutputText@1022a6<br />
          +id: staat<br />
           type: javax.faces.component.html.HtmlSelectOneListbox@152cb9a<br />
            +id: j_id_id22j_id_1<br />
             type: javax.faces.component.UISelectItems@b52bbd<br />
          +id: landLabel<br />
           type: javax.faces.component.html.HtmlOutputLabel@4aa98f<br />
            +id: j_id2<br />
             type: javax.faces.component.html.HtmlOutputText@1c1fbd9<br />
          +id: land<br />
           type: javax.faces.component.html.HtmlSelectOneListbox@7d6683<br />
            +id: j_id_id30j_id_1<br />
             type: javax.faces.component.UISelectItem@d523bb<br />
            +id: j_id_id32j_id_1<br />
             type: javax.faces.component.UISelectItems@11d06f0<br />
          +id: bezirkLabel<br />
           type: javax.faces.component.html.HtmlOutputLabel@b28892<br />
            +id: j_id3<br />
             type: javax.faces.component.html.HtmlOutputText@1244d80<br />
          +id: bezirk<br />
           type: javax.faces.component.html.HtmlSelectOneListbox@5c498e<br />
            +id: j_id_id40j_id_1<br />
             type: javax.faces.component.UISelectItem@e134e6<br />
            +id: j_id_id42j_id_1<br />
             type: javax.faces.component.UISelectItems@1582503<br />
          +id: gemeindeLabel<br />
           type: javax.faces.component.html.HtmlOutputLabel@1e60665<br />
            +id: j_id4<br />
             type: javax.faces.component.html.HtmlOutputText@addd24<br />
          +id: gemeinde<br />
           type: javax.faces.component.html.HtmlSelectOneListbox@91a775<br />
            +id: j_id_id50j_id_1<br />
             type: javax.faces.component.UISelectItem@89178b<br />
            +id: j_id_id52j_id_1<br />
             type: javax.faces.component.UISelectItems@68d102<br />
      +id: j_id5<br />
       type: javax.faces.component.html.HtmlOutputText@171ee01<br />
      +id: suchstringStaat<br />
       type: javax.faces.component.html.HtmlOutputText@c099ef<br />
      +id: j_id6<br />
       type: javax.faces.component.html.HtmlOutputText@ba3d2c<br />
      +id: suchstringLand<br />
       type: javax.faces.component.html.HtmlOutputText@10634e7<br />
      +id: j_id7<br />
       type: javax.faces.component.html.HtmlOutputText@7b2b3e<br />
      +id: suchstringBezirk<br />
       type: javax.faces.component.html.HtmlOutputText@53f9d8<br />
      +id: j_id8<br />
       type: javax.faces.component.html.HtmlOutputText@1380a71<br />
      +id: suchstringGemeinde<br />
       type: javax.faces.component.html.HtmlOutputText@3598ef<br />
    +id: center<br />
     type: javax.faces.component.html.HtmlPanelGroup@cb771e</p>
<p>root cause</p>
<p>javax.servlet.jsp.JspException: Component ID 'liste' has already been used in the view.<br />
See below for the view up to the point of the detected error.<br />
+id: j_id_id18<br />
 type: javax.faces.component.UIViewRoot@b05b39<br />
  +id: j_id0<br />
   type: javax.faces.component.html.HtmlOutputText@3505cb<br />
  +id: content<br />
   type: javax.faces.component.html.HtmlPanelGrid@10f766f<br />
    +id: left<br />
     type: javax.faces.component.html.HtmlPanelGrid@2893ce<br />
      +id: searchForm<br />
       type: javax.faces.component.html.HtmlForm@1ffd008<br />
        +id: j_id_id9j_id_1<br />
         type: javax.faces.component.html.HtmlPanelGrid@1b2cb94<br />
          +id: sucheButton<br />
           type: javax.faces.component.html.HtmlCommandButton@1537e1d<br />
          +id: j_id_id14j_id_1<br />
           type: javax.faces.component.html.HtmlOutputText@7cc058<br />
          +id: staatLabel<br />
           type: javax.faces.component.html.HtmlOutputLabel@3805f9<br />
            +id: j_id1<br />
             type: javax.faces.component.html.HtmlOutputText@1022a6<br />
          +id: staat<br />
           type: javax.faces.component.html.HtmlSelectOneListbox@152cb9a<br />
            +id: j_id_id22j_id_1<br />
             type: javax.faces.component.UISelectItems@b52bbd<br />
          +id: landLabel<br />
           type: javax.faces.component.html.HtmlOutputLabel@4aa98f<br />
            +id: j_id2<br />
             type: javax.faces.component.html.HtmlOutputText@1c1fbd9<br />
          +id: land<br />
           type: javax.faces.component.html.HtmlSelectOneListbox@7d6683<br />
            +id: j_id_id30j_id_1<br />
             type: javax.faces.component.UISelectItem@d523bb<br />
            +id: j_id_id32j_id_1<br />
             type: javax.faces.component.UISelectItems@11d06f0<br />
          +id: bezirkLabel<br />
           type: javax.faces.component.html.HtmlOutputLabel@b28892<br />
            +id: j_id3<br />
             type: javax.faces.component.html.HtmlOutputText@1244d80<br />
          +id: bezirk<br />
           type: javax.faces.component.html.HtmlSelectOneListbox@5c498e<br />
            +id: j_id_id40j_id_1<br />
             type: javax.faces.component.UISelectItem@e134e6<br />
            +id: j_id_id42j_id_1<br />
             type: javax.faces.component.UISelectItems@1582503<br />
          +id: gemeindeLabel<br />
           type: javax.faces.component.html.HtmlOutputLabel@1e60665<br />
            +id: j_id4<br />
             type: javax.faces.component.html.HtmlOutputText@addd24<br />
          +id: gemeinde<br />
           type: javax.faces.component.html.HtmlSelectOneListbox@91a775<br />
            +id: j_id_id50j_id_1<br />
             type: javax.faces.component.UISelectItem@89178b<br />
            +id: j_id_id52j_id_1<br />
             type: javax.faces.component.UISelectItems@68d102<br />
      +id: j_id5<br />
       type: javax.faces.component.html.HtmlOutputText@171ee01<br />
      +id: suchstringStaat<br />
       type: javax.faces.component.html.HtmlOutputText@c099ef<br />
      +id: j_id6<br />
       type: javax.faces.component.html.HtmlOutputText@ba3d2c<br />
      +id: suchstringLand<br />
       type: javax.faces.component.html.HtmlOutputText@10634e7<br />
      +id: j_id7<br />
       type: javax.faces.component.html.HtmlOutputText@7b2b3e<br />
      +id: suchstringBezirk<br />
       type: javax.faces.component.html.HtmlOutputText@53f9d8<br />
      +id: j_id8<br />
       type: javax.faces.component.html.HtmlOutputText@1380a71<br />
      +id: suchstringGemeinde<br />
       type: javax.faces.component.html.HtmlOutputText@3598ef<br />
    +id: center<br />
     type: javax.faces.component.html.HtmlPanelGroup@cb771e</p>
<p>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.<br />
Sun Java System Application Server Platform Edition 9.0_01<br />

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chris_lenz
Offline
Joined: 2004-07-02

I already get this error,
is that a problem of how deep the ids are sticked together.

emiddio
Offline
Joined: 2007-04-16

netbeans 7 has wizard to create JSP pages or fragments, with either
standard or xml syntax.

jsp xml pages end with .jspx
jsp standard pages end with .jsp
both xml and standard fragment pages end with .jspf

when i create brand new Web project with or without JSF as a framework i
get same behavior described below.

always .jsp, and .jspx pages seem to be processed by the JSP servlet.

.jspf pages when invoked directly are only processed by JSP servlet if
they use xml syntax,
standard syntax .jspf pages appear to be not recognized -- processed as
a static text file.

is this a bug ? how can i configure standard jsp syntax fragments using
.jspf to be recognized ?

thanks

gary

kchung
Offline
Joined: 2004-05-06

All web containers contains a mapping for the JSP servlet. This mapping determines what resources are handled by the JSP servlet. For glassfish, this mapping is in domains/domain1/config/default-web.xml:

<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>

As you can see, it only handle *.jsp and *.jspx files by default. If you want the JSP container to handle other files, you'll need to add other url patterns.

However, this not recommended and usually not necessary. JSP fragments (.jspf) are meant to be included (statically) in another JSP page, and may not be a valid JSP page. Also, if a jsp page is a JSF page, then it need to be referenced with a JSF suffix (.jsf or .faces, depending on the mapping for jsf servlet).

chris_lenz
Offline
Joined: 2004-07-02

Don't know the error
but now it works :-)