https://bz.apache.org/bugzilla/show_bug.cgi?id=58117
Bug ID: 58117
Summary: Strange XML entity escaping in JSPX files
Product: Tomcat 8
Version: 8.0.22
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P2
Component: Jasper
Assignee: [email protected]
Reporter: [email protected]
We are in the process of switching from Tomcat 7.0.27 to Tomcat 8 (currently:
8.0.22). During this process we noticed changes to the behaviour of escaping
XML entities inside and outside attributes.
Consider this example:
The goal is to produce valid HTML5 markup that looks like this:
<span data-text="A – B"> </span>
<span>A – B</span>
In tomcat 7 I have to use this JSPX code:
<span data-text="A &ndash; B"> </span>
<span>A &ndash; B</span>
1. It's impossible to use – in the JSPX code as the jsp compiler would
stumble over unknown XML entities (which – is)
2. & gets un-escaped to & in the HTML markup, so the browser only sees
– which produces the desired output.
In Tomcat 8, however, the same JSPX input produces this output:
<span data-text="A &ndash; B"/>
<span>A – B</span>
To me this looks wrong. I'd either expect this to produce exactly the same
output as Tomcat 7 or to at least be consistent. (This behaviour makes it also
impossible to use HTML entities inside attributes btw since we cannot produce
– as value of an attribute anymore. Without using hacks, that is.)
Regards
Markus
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]