分享好友 天南地北首页 网站导航

什么是<c:remove>

网友 2023-09-05 18:18 · 头闻号教育培训

最佳答案:

<c:remove>标签用于删除数据

详情介绍

<c:remove>标签用于删除数据

语法
<c:remove var="varName" />
用途
<c:remove>标签用于删除数据

语法:

<c:remove var="varName" />

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

免责声明:本平台仅供信息发布交流之途,请谨慎判断信息真伪。如遇虚假诈骗信息,请立即举报

举报
反对 0
打赏 0
更多相关文章

收藏

点赞