I know to avoid escaping HTML characters in JSTL to use this:
<c:out value="${my.value}" escapeXml="false" />
I am wondering if there exists a page directive to make escapeXml false by default, so I need not specify it on that particular page.
The above does not escape HTML, since escapeXml
is set to false. By default, escapeXml
is true, and the <c:out>
tag thus escapes the HTML. If you don't want to escape, you could simply use
${my.value}
and avoid using <c:out>
completely, since the only purpose of <c:out>
is to escape HTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With