<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <c:catch var="msg"> <% int i = 1/0; %> </c:catch> ${msg}
c:redirect JSTL
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <c:redirect url="http://www.google.com"> <c:param name="q">Servlet Examples</c:param> </c:redirect>
c:url and c:param JSTL
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <c:url value="/header.jsp" var="i" scope="request"/> ${i} <br> <c:url value="/header.jsp"> <c:param name="nm" value="abc"/> <c:param name="address" value="abc"/> </c:url>
c:import JSTL
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <c:import url="http://www.google.com"/> This is main page. Welcome to my website...!!! <!-- <c:import url="http://localhost:8080/JSTL2015d/header.jsp" /> <br> This is main page <br> <c:import url="http://localhost:8080/JSTL2015d/header.jsp" var="i" /> ${i}-->
c:set and c:remove JSTL
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <c:set var="m" value="<%= new java.util.HashMap()%>" scope="request"/> <c:set target="${m}" property="fnm" value="Bill"/> <c:set target="${m}" property="lnm" value="Gates"/> <c:set target="${m}" property="address"> ${m.fnm} ${m.lnm} Microsoft, USA </c:set> Using EL: ${m.address} <!-- <c:set var="msg" value="this is request scope" scope="request"/> <c:set var="msg" value="this is session scope" scope="session"/> <c:set var="msg" value="this is application scope" scope="application"/> <c:set var="msg">This is page scope</c:set> Before Remove: <c:out value="${msg}"/> <br> <c:remove var="msg" scope="request"/> After Remove: <c:out value="${msg}"/> -->