DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12606>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12606 jasper2 sometimes creates multiple declarations of the same variable name in the generated servlet - jsp compilation fails Summary: jasper2 sometimes creates multiple declarations of the same variable name in the generated servlet - jsp compilation fails Product: Tomcat 4 Version: 4.1.10 Platform: PC OS/Version: Linux Status: NEW Severity: Major Priority: Other Component: Jasper 2 AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] the new optimization in jasper2 sometimes creates multiple declarations of the same variable name in the generated servlet - jsp compilation fails. It happened for me on strut's <logic:iterate> tags. the two variables were the "id" and the "indexId" attribute of the tag: GENERATED SERVLET (snippett): public void _jspService(...) throws ... { JspFactory _jspxFactory = null; ... JspWriter _jspx_out = null; /* FIRST DECL *********************************/ org.sureguidance.Comment _jspx_comment_1 = null; java.lang.Integer _jspx_commentIndex_1 = null; /**********************************************/ try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html;charset=ISO-8859-1"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); ... do { out.write("\n "); /* ---- logic:iterate ---- */ /* SECOND DECL *********************************/ org.sureguidance.Comment _jspx_comment_1 = comment; java.lang.Integer _jspx_commentIndex_1 = commentIndex; /**********************************************/ note that in the second decl, the variables "comment" and "commentIndex" were not defined previously in the servlet: cause for another compilation error. JSP: ... <div class="LeftSubNavStyle"> <logic:iterate id="section" name="chapter" property="sectionsList" type="org.sureguidance.Section" indexId="sectionIndex"> <logic:iterate id="comment" name="section" property="commentsList" type="org.sureguidance.Comment" indexId="commentIndex"> <bean:define id="commentAnchor" name="comment" property="anchor" type="java.lang.String"/> <logic:notEqual name="comment" property="subject" value=""> <b><bean:write name="comment" property="index"/>.</b> note that "section" and "sectionIndex" do not have this problem ???? contact me if you need complete code and the error page. thanx, you guys rock!!! -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>