Source Code : JSTL Set Variables Scope
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
JSTL Set Variables Scope
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
<title>Set in Scope Examples</title>
</head>
<body>
<c:set var="test" value="Page Level Value" scope="page" />
<c:set var="test" value="Request Level Value"
scope="request" />
<c:set var="test" value="Session Level Value"
scope="session" />
<c:set var="test" value="Application Level Value"
scope="application" />
<table border="1">
<tr>
<td>
<b>Default Level</b>
</td>
<td>
<c:out value="${test}" />
</td>
</tr>
<tr>
<td>
<b>Page Level</b>
</td>
<td>
<c:out value="${pageScope.test}" />
</td>
</tr>
<tr>
<td>
<b>Request Level</b>
</td>
<td>
<c:out value="${requestScope.test}" />
</td>
</tr>
<tr>
<td>
<b>Session Level</b>
</td>
<td>
<c:out value="${sessionScope.test}" />
</td>
</tr>
<tr>
<td>
<b>Application Level</b>
</td>
<td>
<c:out value="${applicationScope.test}" />
</td>
</tr>
</table>
</body>
</html>
Thank with us