728x90
728x90
SMALL
fn:escapeXml()
- XML 마크업으로 해석될 수 있는 문자를 이스케이프합니다.
Syntax
java.lang.String escapeXml(java.lang.String)
Example
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
<title>JSTL functions escapeXml</title>
</head>
<body>
<c:set var="str1" value="This is normal String."/>
<c:set var="str2" value="<a>This is XML String</a>"/>
<p>With escapeXml() Function</p>
<p>str1 : ${fn:escapeXml(str1)}</p>
<p>str2 : ${fn:escapeXml(str2)}</p>
<p>Without escapeXml() Function:</p>
<p>str1 : ${str1}</p>
<p>str2 : ${str2}</p>
</body>
</html>
Result
With escapeXml() Function
str1 : This is normal String.
str2 : <a>This is XML String</a>
Without escapeXml() Function:
str1 : This is normal String.
str2 : This is XML String
728x90
728x90
LIST
'JSP > JSTL functions' 카테고리의 다른 글
[JSP][JSTL functions] fn:join() (0) | 2021.07.26 |
---|---|
[JSP][JSTL functions] fn:indexOf() (0) | 2021.07.26 |
[JSP][JSTL functions] fn:endsWith() (0) | 2021.07.25 |
[JSP][JSTL functions] fn:containsIgnoreCase() (0) | 2021.07.25 |
[JSP][JSTL functions] fn:contains() (0) | 2021.07.25 |