This content has been marked as final.
Show 1 reply
-
1. Re: Is it possible to disable hash and percentage escaping in JSP
japerezf May 7, 2015 1:42 PM (in response to romanj)Hi Jan, you can do this:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:out value="escape"/>
or
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
${fn:escapeXml(escape)}
If you want to disable, a custom servlet context listener registers the custom ELResolver when the application starts. To use it, define a listener in the web.xml file. For more details: ELResolver Escapes JSP EL Values To Prevent Cross-Site Scripting
References:
jsp - JSTL escaping special characters - Stack Overflow
How to escape HTML Special characters in JSP and Java | Java67
Regards
J.P