CodesJava

Easy learning with example program codes

JSTL fn:escapeXml() function


The JSTL fn:escapeXml() function is used to escape the html, xml or any other tag which can be treated as xml markup.

Syntax: String escapeXml(String giventring)

Example:

test.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
 
<html>
	<head>
		<title>fn:escapeXml JSTL function example</title>
	</head>
	<body>
		<c:set var="testString" 
                 value="<h4>Hello this is a JSTL function example</h4>"/>
		<h4>String without using escapeXml function.</h4>
		${testString}<br/>
		<h4>String with using escapeXml function.</h4>	
		${fn:escapeXml(testString)}		
	</body>
</html>

web.xml

<web-app>
 
  <welcome-file-list>
          <welcome-file>test.jsp</welcome-file>
  </welcome-file-list>	
 
</web-app>

Output:

jsp example 56
 
Download this example.
 
Next Topic: JSTL fn:indexOf() function with example.
Previous Topic: JSTL fn:endsWith() function with example.

Related Topics:

JSTL fn:contains() function with example.
JSTL fn:containsIgnoreCase() function with example.
JSTL fn:startsWith() function with example.
JSTL fn:endsWith() function with example.
JSTL fn:escapeXml() function with example.
JSTL fn:indexOf() function with example.
JSTL fn:join() and fn:split() function with example.
JSTL fn:length() function with example.
JSTL fn:replace() function with example.
JSTL fn:subString() function with example.
JSTL fn:subStringAfter() function with example.
JSTL fn:subStringBefore() function with example.
JSTL fn:toLowerCase() function with example.
JSTL fn:toUpperCase() function with example.
JSTL fn:trim() function with example.

 

Sign Up/ Sign In
Ask a Question


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki