Bug 55207 - In XML syntax, jsp:text does not error on sub-elements from other namespaces
Summary: In XML syntax, jsp:text does not error on sub-elements from other namespaces
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 8.0.x-trunk
Hardware: PC Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-07 01:11 UTC by Jeremy Boynes
Modified: 2016-08-29 14:21 UTC (History)
1 user (show)



Attachments
patch to reject on any element inside <jsp:text> (1.34 KB, text/plain)
2013-07-07 01:11 UTC, Jeremy Boynes
Details
patch to reject on any element inside <jsp:text> (1.32 KB, patch)
2013-07-07 01:13 UTC, Jeremy Boynes
Details | Diff
patch to reject on any element inside <jsp:text> (1.31 KB, patch)
2013-07-07 01:59 UTC, Jeremy Boynes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Boynes 2013-07-07 01:11:30 UTC
Created attachment 30557 [details]
patch to reject on any element inside <jsp:text>

JspDocumentParser does check for sub-elements within a jsp:text element but only fails if they are from the jsp namespace
Comment 1 Jeremy Boynes 2013-07-07 01:13:33 UTC
Created attachment 30558 [details]
patch to reject on any element inside <jsp:text>
Comment 2 Jeremy Boynes 2013-07-07 01:59:38 UTC
Created attachment 30559 [details]
patch to reject on any element inside <jsp:text>

There is an additional problem here in that the check is assuming the name of the <jsp:text> node is "jsp:text" - it does not allow for the case where a different prefix is being used. This applies to the current implementation as well where nested <foo:text><foo:text> will not error if foo: is the JSP namespace.

Updated the check to use the type of the parent Node rather than the XML
Comment 3 Mark Thomas 2013-07-10 19:40:51 UTC
Thanks for the patch. It has been applied to trunk and 7.0.x and will be included in 7.0.43 onwards.