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

Error handling: balanced <% checking easily fooled

           Summary: Error handling: balanced <% checking easily fooled
           Product: Tomcat 4
           Version: 4.1.3
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Jasper 2
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Hi,

Consider this invalid JSP page:

<%
String userName=request.getParameter("name");
<br>
hello there, <%= name %>


There, I forgot to close the <%. But instead of reporting as much, Jasper 2
returns:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:


        at
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120)
        at
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:248)
        at org.apache.jasper.JspEngineContext.compile(JspEngineContext.java:356)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:157)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)


The %> in '<%= name %>' bypasses Jasper's checking for well-balanced <%'s. Of
course, I encountered this in a much more complex page ;)


thanks,

--Jeff

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to