------------------------------------------------------------------------------------------------------------------------------------------
3. <c:remove>
库 :Core(核心库)
URI : http://java.sun.com/jsp/jstl/core
前缀 : c
描述 : <c:remove>标签用于删除存在于 scope 中的变量。 类似于 <%session.removeAttribute(“name”)
%> 、
<%request.removeAttribute(“name”)%>...
语法 :
<c:remove var="varName" [scope="{page|request|session|application}"]/>
属性 :
属性名 描述 类型 是否
接受
动态
值
是否
支持
EL
是否
必须
默认值 说明
var
变量名
String N
N
是 无
欲移除变量的名称
scope
范围
String N
N
否
page
var 变量的 JSP 范围; 若没有指
定,默认为全部查找
------------------------------------------------------------------------------------------------------------------------------------------
实例 :
Example1
<c:remove var="sampleValue" scope="session"/>
${sessionScope.sampleValue}
------------------------------------------------------------------------------------------------------------------------------------------
Example2
<c:remove var="username" scope="session"/>