Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 144812 - JSP parser fails parsing strings inside scriptlet sections if they contain "%>"
Summary: JSP parser fails parsing strings inside scriptlet sections if they contain "%>"
Status: CLOSED INVALID
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 1.5   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David Williams CLA
QA Contact: David Williams CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-31 20:09 EDT by Patric Rufflar CLA
Modified: 2006-11-28 15:49 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patric Rufflar CLA 2006-05-31 20:09:03 EDT
Hello everyone,

the following problem occours on WTP 1.5 RC4:

1. create a new jsp
2. paste the following:
<% 
String bla = "%>";

<b>As you can see, this is wrongly recognized as a html section

The parser marks line 2 as an error but this code seems correct.

Best Regards,
Patric Rufflar
Comment 1 David Williams CLA 2006-06-01 04:03:55 EDT
I'll admit, I didn't look up the spec right now, but I do believe that 
the '%>' is supposed to be taken as the matching end of previous '<%'. 
And that if you really wanted '%>' in the string, you'd have to escape them. 

Please re-open if you can point me that part of the JSP spec which would prove me wrong. 
Comment 2 Nitin Dahyabhai CLA 2006-06-01 16:07:37 EDT
Running it through Tomcat, I get this error:

Jun 1, 2006 4:09:15 PM org.apache.jasper.compiler.Compiler generateClass
SEVERE: Error compiling file: /D:/jakarta-tomcat-5.0.28/work/Catalina/localhost/webApp//org/apache/jsp\test4_jsp.java     [javac] Compiling 1 source file

D:\jakarta-tomcat-5.0.28\work\Catalina\localhost\webApp\org\apache\jsp\test4_jsp.java:43: unclosed string literal
String bla = "
             ^
1 error
Comment 3 John Lanuti CLA 2006-11-28 15:49:05 EST
This is part of a mass update to close out all stale WTP bugs which are in the resolved state without an appropriate targeted version.  If you feel this bug was closed inappropriately, please reopen.