<c:remove>標籤用於刪除數據

語法:
<c:remove var="varName" [scope="{ page|request|session|application }"] />
<c:remove>標籤用於刪除數據,它有如下屬性:
名 稱
說 明
EL
類型
必須
默認值
var
欲移除的變數名稱
N
String
scope
var變數的JSP範圍
N
String
page
scope範圍,包括page、request、session、application等;
例:
<c:remove var="test2" scope="session"/>
從session中刪除test2變數。
教材例程15-4,c_remove.jsp,<c:remove>標籤的套用。
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<html>
<head>
<title>JSTL:c:remove的使用</title>
</head>
<body bgcolor="#FFFFFF">
<c:set value="10000" var="maxUser" scope="application"/>
<c:set value="20" var="maxIdelTime" scope="session"/>
<c:set value="hellking" var="accountId" scope="request"/>
<c:set value="next.jsp" var="nextPage" scope="page"/>
在沒有調用c:rmeove之前,有這些參數:
maxUser=<c:out value="${maxUser}"/>,
maxIdelTime=<c:out value="${maxIdelTime}"/>,
accountId=<c:out value="${accountId}"/>,
nextPage=<c:out value="${nextPage}"/>。
<hr>調用c:remove...
<c:remove var="maxUser" scope="application"/>
<c:remove var="maxIdelTime" scope="session"/>
<c:remove var="accountId" scope="request"/>
<c:remove var="nextPage" scope="page"/>
調用了c:remove後,這些參數值為:
maxUser=<c:out value="${maxUser}"/>,
maxIdelTime=<c:out value="${maxIdelTime}"/>,
accountId=<c:out value="${accountId}"/>,
nextPage=<c:out value="${nextPage}"/>,
</body>
</html>

相關詞條

熱門詞條

聯絡我們