Bug 54821 - Error trying to parse EL in JSP XML documents when isELIgnored = true
Summary: Error trying to parse EL in JSP XML documents when isELIgnored = true
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 7.0.39
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-09 22:41 UTC by Konstantin Kolinko
Modified: 2013-04-25 13:21 UTC (History)
0 users



Attachments
page3.jspx (983 bytes, text/plain)
2013-04-09 22:42 UTC, Konstantin Kolinko
Details
page4.jspx (982 bytes, text/plain)
2013-04-09 22:42 UTC, Konstantin Kolinko
Details

Note You need to log in before you can comment on or make changes to this bug.
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.