Bug 55207 - In XML syntax, jsp:text does not error on sub-elements from other namespaces
In XML syntax, jsp:text does not error on sub-elements from other namespaces
Status: RESOLVED FIXED
Product: Tomcat 8
Classification: Unclassified
Component: Jasper
trunk
PC Mac OS X 10.4
: P2 normal (vote)
: ----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-07-07 01:11 UTC by Jeremy Boynes
Modified: 2013-07-10 19:40 UTC (History)
0 users



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.