I will go one better: app scope and session scope, and you can remove
them too. ;-)
Larry
===
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Application attributes</title>
</head>
<body>
<%
String remObjName = request.getParameter("remObjName");
if(null != remObjName &&
request.getParameter("action").equalsIgnoreCase("remove")){
System.err.println("Removing: " + remObjName + " from " +
request.getParameter("scope") + " scope.");
if(request.getParameter("scope").equalsIgnoreCase("app")){
application.removeAttribute(remObjName);
}
if(request.getParameter("scope").equalsIgnoreCase("session")){
System.err.println("Removing: " + remObjName + "\n");
session.removeAttribute(remObjName);
System.err.println("Removed: " + remObjName + "\n");
}
System.err.println("Removed: " + remObjName + " from " +
request.getParameter("scope") + " scope.");
response.sendRedirect(request.getRequestURI());
}
%>
<table>
<tr>
<th colspan='3'>Application scope</th>
</tr>
<tr>
<th></th>
<th align="left">Name</th>
<th align="left">Object information</th>
</tr>
<tr><td /><td colspan='3' bgcolor='#ccccff' /></tr>
<%
out.write("<tr><td></td><td>Application object</td><td>" +
application.toString() + "</td></tr>");
out.write("<tr><td /><td colspan='3' bgcolor='#ccccff' /></tr>");
java.util.Enumeration appObj = application.getAttributeNames();
String appObjName;
while(appObj.hasMoreElements()){
appObjName = appObj.nextElement().toString();
out.write("<tr>");
out.write("<td><a href='?remObjName=" + appObjName +
"&action=remove&scope=app'>clear</a></td>");
out.write("<td>" + appObjName + "</td>");
out.write("<td>" + application.getAttribute(appObjName) + "</td>");
out.write("</tr>");
out.write("<tr><td /><td colspan='3' bgcolor='#ccccff'
/></tr>");
}
%>
<tr>
<th colspan='3'>Session scope</th>
</tr>
<tr>
<th></th>
<th align="left">Name</th>
<th align="left">Object information</th>
</tr>
<tr><td /><td colspan='3' bgcolor='#ccccff' /></tr>
<%
out.write("<tr><td></td>");
out.write("<td>Session object</td><td>" + session.toString() +
"</td></tr>");
out.write("<tr><td /><td colspan='3' bgcolor='#ccccff' /></tr>");
java.util.Enumeration sessionObj = session.getAttributeNames();
String sessionObjName;
while(sessionObj.hasMoreElements()){
sessionObjName = sessionObj.nextElement().toString();
out.write("<tr>");
out.write("<td><a href='?action=remove&scope=session&remObjName=" +
sessionObjName + "'>clear</a></td>");
out.write("<td>" + sessionObjName + "</td>");
out.write("<td>" + session.getAttribute(sessionObjName) + "</td>");
out.write("</tr>");
out.write("<tr><td /><td colspan='3' bgcolor='#ccccff' /></tr>");
}
%>
<tr>
<th colspan='3'>System scope</th>
</tr>
<tr>
<th></th>
<th align="left">Name</th>
<th align="left">Object information</th>
</tr>
<tr><td /><td colspan='3' bgcolor='#ccccff' /></tr>
<%
java.util.Enumeration propObj = System.getProperties().keys();
String propObjName;
while(propObj.hasMoreElements()){
propObjName = propObj.nextElement().toString();
out.write("<tr>");
//out.write("<td><a href='?action=remove&scope=session&remObjName=" +
sessionObjName + "'>clear</a></td>");
out.write("<td></td>");
out.write("<td valign='top'>" + propObjName + "</td>");
out.write("<td valign='top'>" + System.getProperty(propObjName) +
"</td>");
out.write("</tr>");
out.write("<tr><td /><td colspan='3' bgcolor='#ccccff' /></tr>");
}
%>
</table>
</body>
</html>
===
>>> [EMAIL PROTECTED] 05/16/02 05:18PM >>>
is it possible to list all session beans which are active? i need this
to keep my memory clean.