tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21753] New: - Custom tags within multiline comments generate compile error
Date Mon, 21 Jul 2003 00:20:55 GMT
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=21753>.
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=21753

Custom tags within multiline comments generate compile error

           Summary: Custom tags within multiline comments generate compile
                    error
           Product: Tomcat 5
           Version: Nightly Build
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Jasper2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: ecarmich@alumni.rice.edu


Jasper generates incorrect Java code when compiling a JSP page which contains 
a custom tag inside a multiline comment, such as the following:

<%@ taglib uri="/test" prefix="test" %>

Hello World
<%
/*
%>

<test:test/>

<%
*/
%>

This is the error message return by the Java compiler:

Generated servlet error:
    [javac] Compiling 1 source file

C:\jakarta-tomcat-5
\build\work\Catalina\localhost\webapp\org\apache\jsp\test_jsp.java:76: illegal 
start of expression
*/
^

The problem is that generateCustomStartTag and generateCustomDoTag insert 
multiline comments of their own.  The Java compiler interprets the "*/" at the 
end of the inserted multiline comment as the end of the multiline comment from 
the JSP page, and returns an error when it finds the closing "*/" from the JSP 
page.

I will attach a patch that fixes this.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message