The removal of JavaBean varies with different ranges.
Page range, request range, session range, and application range use pageContext, request, session, and application
All methods use the removeAttribute () method.
Example
01
<% @ Page language = "java" contentType = "text/html; charset = gb2312" %>
02
<! DOCTYPE html>
03
<Html>
04
<Head>
05
<Title> set the page range </title>
06
</Head>
07
<Body>
08
<% -- Call JavaBean through useBean Action Command -- %>
09
<Jsp: useBean id = "user" scope = "application" class = "com. javaweb. ch07.UserBean"> </jsp: useBean>
10
<%
11
// Remove the attribute of the application range
12
Application. removeAttribute ("user ");
13
%>
14
<% -- Set attributes in JavaBean based on all parameters -- %>
15
<Jsp: getProperty name = "user" property = "username"/>
16
<Jsp: getProperty name = "user" property = "password"/>
17
</Body>
18
</Html>
From Zhang Dapeng's blog