首页 文章 JSTL 代码:用JSTL移除属性

邮件订阅

代码:用JSTL移除属性 E-mail
用户评价: / 0
好 
技术文章 - JSTL
作者:Administrator   
2007-12-01 22:18

    

JSTL: Remove the attributes


JSTL: Remove the attributes

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

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

<html>
  <head>
    <title>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>

//removeAttribute.jsp

<%@ 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}" />"
  </body>
</html>
最后更新于: 2007-12-01 22:18
 

欢迎转载

本站文章欢迎转载,但请注明出处(http://www.javajia.com,Java家)