In JSP:
<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<% String str = "<abc & ' \">"; %>
<html>
<body>
<p>Escaped string: <%= fn:escapeXml(str) %> </p>
</body>
</html>
This requires the JSTL 1.2 JAR, which can be downloaded at https://mvnrepository.com/artifact/javax.servlet/jstl/1.2
Sunday, September 10, 2017
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment