<c:set var="variable_name" value="value" scope="page|session|request|application">
As the example above indicates, we can select among the four available scopes:
- page
- request
- session
- application
The variable can be printed out with the <c:out> tag. It can be accessed in EL (expression language) with the following syntax:
${pageScope.variable_name}
${requestScope.variable_name}
${sessiomScope.variable_name}
${applicationScope.variable_name}
and from within a scriptlet as follows:
${requestScope.variable_name}
${sessiomScope.variable_name}
${applicationScope.variable_name}
<%= pageContext.getAttribute(variable_name) %>
<%= request.getAttribute(variable_name) %>
<%= session.getAttribute(variable_name) %>
<%= application.getAttribute(variable_name) %>
<%= request.getAttribute(variable_name) %>
<%= session.getAttribute(variable_name) %>
<%= application.getAttribute(variable_name) %>
No comments:
Post a Comment