Tags | Description |
---|---|
core tag | Provides URL management, flow control, variable support etc. The prefix of the core tag is 'c'. |
sql tag | It provides the SQL support in JSP application. The prefix of sql tag is 'sql'. |
XML tag | Provides the flow control, transformation etc. the prefix is 'x'. |
function tag | Used to provide support for string manipulation and String length. The prefix is 'fn'. |
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Core Tag Example</title>
</head>
<body>
<c:catch>
<%
int result = 50/0;
%>
</ c:catch>
</body>
</html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title><c:if> Core tag</title>
</head>
<body>
<c:set var="number" scope="session" value="${700}">
<c:if test="${number>500}">
<c:out value="number is less than 500"></c:out>
</c:if>
</body>
</html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Tag Example</title>
</head>
<body>
<h1>import Tag example</h1>
<c:import url="http://www.tutorialride.com">
<c:param name= "Tutorial" value= "true">
</c:import>
</body>
</html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Tag Example</title>
</head>
<body>
<h2>out tag example</h2>
<c:out value="${param.name}" default="TutorialRide" >
</body>
</html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Redirect Tag Example</title>
<head>
<body>
<c:redirect url="http://tutorialride.com/"></c:redirect>
</body>
</html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Core Tag Example</title>
</head>
<body>
<h1>c:when, c:otherwise, c:choose</h1>
<c:set value="45" var="num"></c:set>
<c:choose>
<c:when test="${num%2 == 0}">
<c:out value="It is Even Number"></c:out>
</c:when>
<c:otherwise>
<c:out value="It is Odd Number"></c:out>
</c:otherwise>
</c:choose>
</body>
</html>