<c:remove>

王朝百科·作者佚名  2010-02-15  
宽屏版  字体:   |    |    |  超大  

语法:

<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>

 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝百科 版权所有