You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/06/18 16:30:33 UTC

DO NOT REPLY [Bug 9958] New: - JSTL page compile fails with many JSTL core tags

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=9958>.
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=9958

JSTL page compile fails with many JSTL core tags

           Summary: JSTL page compile fails with many JSTL core tags
           Product: Tomcat 4
           Version: 4.0.4 Final
          Platform: Sun
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: jesse@noitatieto.fi


Setting:
- a JSTL page using only jstl-c (el version), <c:out>.
- JSTL version is the 1.0 (copied from jwsdp-1.0).
- SunOS host 5.8 Generic_108528-13 sun4u sparc SUNW,UltraSPARC-IIi-cEngine
- java version "1.4.0"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
  Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
- JAVA_OPTS=-mx256m
- W2k/tomcat-4.0.3/sun java 1.4.0 has the same problem -> probably
  cross-platform
- Sample page below below

Problem:
 Adding one more <c:out>-tag causes the exception below. By removing a <c:out>
from the crashing jsp -> the jsp compiles correctly. There is the same
problem with tomcat 4.0.3, but the needed amount of JSTL tags is somewhat lower
The problem seems to be gone in 4.1.5, but it has other issues (alongside not
being 'release').

 The line of code referenced by the exception is generated from the line of jsp
with the second-last <c:out> tag (if the comment lines are to be trusted in the
generated .java).

 Below is also the part from the generated .java, and I can't see the problem.
The file also compiles manually like it should (javac -classpath world:and:dog
a$jsp.java).

the exception:
---8<---
org.apache.jasper.JasperException: Unable to compile class for JSPNote:
sun.tools.javac.Main has been deprecated.


An error occurred at line: 56 in the jsp file: /a.jsp

Generated servlet error:
/mnt/project/jakarta-tomcat-4.0.4/work/Standalone/localhost/jesse/a$jsp.java:1813:
Variable _jspx_th_c_out_51 may not have been initialized.
                          } while (_jspx_th_c_out_51.doAfterBody() ==
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
                                   ^


An error occurred at line: 56 in the jsp file: /a.jsp

Generated servlet error:
/mnt/project/jakarta-tomcat-4.0.4/work/Standalone/localhost/jesse/a$jsp.java:1819:
Variable _jspx_th_c_out_51 may not have been initialized.
                  if (_jspx_th_c_out_51.doEndTag() ==
javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
                      ^
2 errors, 1 warning

	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
	at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
-snip-
---8<---

part of the generated code:
---8<---
                  int _jspx_eval_c_out_51 = _jspx_th_c_out_51.doStartTag();
                  if (_jspx_eval_c_out_51 !=
javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
                      try {
                          if (_jspx_eval_c_out_51 !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                              out = pageContext.pushBody();
                             
_jspx_th_c_out_51.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
                              _jspx_th_c_out_51.doInitBody();
                          }
                          do {
                          // end
                          // begin [file="/a.jsp";from=(55,0);to=(55,21)]
                          } while (_jspx_th_c_out_51.doAfterBody() ==
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGA
IN);    
                      } finally {  
                          if (_jspx_eval_c_out_51 !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
                              out = pageContext.popBody();
                      } 
---8<---

sample page:
---8<---
<html>
<%@ taglib uri="/jstl-c" prefix="c" %>
<head><title> a </title></head>
<body>
<c:out value="TEST"/><br>
...repeat the line above for 51 more times...
</body>
</html>
---8<---

sample web.xml:
---8<---
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <taglib> 
    <taglib-uri>/jstl-c</taglib-uri>
    <taglib-location>/WEB-INF/jstl/c.tld</taglib-location>
  </taglib>
</web-app>
---8<---

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