Bug 54821

Summary: Error trying to parse EL in JSP XML documents when isELIgnored = true
Product: Tomcat 7 Reporter: Konstantin Kolinko <knst.kolinko>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 7.0.39   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: page3.jspx
page4.jspx

Description Konstantin Kolinko 2013-04-09 22:41:24 UTC
I noted this issue while reviewing code for bug 54801.
Reproducible with current 7.0 = 7.0.39.

Steps to reproduce:
1. Put the attached "page3.jspx" and "page4.jspx" files into examples webapp.

Page 3:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:directive.page isELIgnored="true"/>
${Hello, world!!}
</jsp:root>

Page 4:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:directive.page isELIgnored="true"/>
${Hello, world!!
</jsp:root>

2. Start Tomcat
3. Access http://localhost:8080/examples/page3.jspx
This works as expected and prints "${Hello, world!!}"

4. Access http://localhost:8080/examples/page4.jspx
This fails with error 500,

org.apache.jasper.JasperException: /page4.jspx (line: 21, column: 12) Unterminated ${ tag

* root cause *:
org.xml.sax.SAXParseException: Unterminated ${ tag
org.apache.jasper.compiler.JspDocumentParser.processChars(JspDocumentParser.java:538)
org.apache.jasper.compiler.JspDocumentParser.endElement(JspDocumentParser.java:610)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
Comment 1 Konstantin Kolinko 2013-04-09 22:42:03 UTC
Created attachment 30170 [details]
page3.jspx
Comment 2 Konstantin Kolinko 2013-04-09 22:42:24 UTC
Created attachment 30171 [details]
page4.jspx
Comment 3 Mark Thomas 2013-04-25 13:21:35 UTC
Fixed in trunk and will be included in 7.0.40 onwards.
I turned the example JSP documents into unit tests.