JSTL Core Tag


JSTL Core <c:out> Tag

JSTL Core <c:out> tag is use to display output on JSP page, JSTL Core <c:out> tag is similar to <% out.println %> of JSP.

Example of c:out tag

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
 pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JSTL Examples</title>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
</head>
<body>
   <c:out value="${'Welcome to www.javagf.com'}" />
</body>
</html>

Output

Welcome to www.javagf.com

c:out escapes HTML and XML characters means it will treat all the information as text only.

Example

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
 pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JSTL Examples</title>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
</head>
<body>
 <c:out value="${'<h1>Welcome to www.javagf.com</h1>'}" />
</body>
</html>

Output

<h1>Welcome to www.javagf.com</h1>






Full-stack web and mobile app development company Contact Us : Skype: indore.webcoder Email: info@w3sparks.com Sales: +91 8085506229