You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Bowman <mi...@comcast.net> on 2002/09/25 01:33:07 UTC

Is JSP compiler working right?

I have a JSP page with two iterator tags:

<%@ taglib uri='/WEB-INF/struts-logic.tld' prefix='logic' %>
<logic:iterate name="routes" id="route" type="com.arinc.dce.routes.RouteVO">
   <logic:iterate name="route" id="seg" property="segments"
      type="com.arinc.dce.routes.RouteSegment">
   </logic:iterate>
</logic:iterate>

I'm populating the list of RouteVOs like this:

List routeVOs = new ArrayList(routes.size());
for(Iterator i = routes.iterator(); i.hasNext(); ) {
   RouteBean r = (RouteBean) i.next();
   RouteVO rvo = new RouteVO(r);
   routeVOs.add(rvo);
}
request.setAttribute("routes", routeVOs);

I'm getting an exception that says:

2002-09-24 07:20:13 ApplicationDispatcher[/dce] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP
<snip>
----- Root Cause -----
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 4 in the jsp file: /WEB-INF/jsp/multiRouteListContent.jsp

Generated servlet error:
    [javac] Compiling 1 source file
/usr/local/jakarta-tomcat-4.1.10/work/Standalone/localhost/dce/WEB-INF/jsp/multiRouteListContent_jsp.java:77: _jspx_seg_1 is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
          com.arinc.dce.routes.RouteSegment _jspx_seg_1 = seg;

When I look at the code that the JSP compiler generates I see:

    com.arinc.dce.routes.RouteSegment _jspx_seg_1 = null;

and further down:

   /* ----  logic:iterate ---- */
   com.arinc.dce.routes.RouteSegment _jspx_seg_1 = seg;

Why is the servlet code generator doing this? I don't understant why it re-declares the variable when it hits the loop. Does anyone know how to get around this problem?

I've attached the full text of the exception and the code generated by the JSP compiler.

Any help would be appreciated. I've searched the mailing list to no avail.

Thanks,
Michael Bowman

jsp frame and tomcat

Posted by Frederic Barozzi <fr...@ifrance.com>.
Sorry i send an other cause i don't know where is the last email i sent.

I've got a forward in my struts-config.xml to a /form/main.jsp.

My main.jsp calls tree frames. It works fine when i call
http://localhost:8080/myApp/form/main.jsp
but not after a login jsp page with the forward condition explained in the
struts-config.xml.

I read there are problems with frame but i don't really understant which
ones
any idea, or help ?

regards

Fred




________________________________________________________________
Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 euros d'économies !
Et pour 1 euro de plus, reçois le CD-ROM du jeu Dark Age of Camelot
+ 1 mois de jeu en réseau offert ! 
Clique ici : http://www.ifrance.com/_reloc/mail.etudiant 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>