Remove Attribute From Session : Session « JSTL « Java Tutorial






<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<c:set var="userName" value="Mark" scope="session" />

<html>
  <head>
    <title>Chapter 5 - Set a scoped attribute</title>
  </head>
  <body>
    This page sets a session-scoped attribute that is removed
    by <a href="removeAttribute.jsp">this</a> page.
  </body>
</html>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<html>
  <head>
    <title>Remove a scoped attribute</title>
  </head>
  <body>
    The session-scoped attribute called <b>userName</b> had a value
    of <b> <c:out value="${sessionScope.userName}" /> </b>, but it is about
    to be removed!<p/>

    <c:remove var="userName" scope="session" />

    The value is now "<c:out value="${sessionScope.userName}" />" - NYA ha ha ha ha!
  </body>
</html>
  Download:  JSTLRemoveAttributeFromSession.zip( 1,022 k)








24.29.Session
24.29.1.Use JSTL to Deal with Session
24.29.2.Get HTTP Session by using JSTL
24.29.3.View Session Date using JSTL
24.29.4.Update Session Date using JSTL
24.29.5.Set Variable Scope to Session
24.29.6.Remove Attribute From Session