列出jsp中的所有session

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
Enumeration e=session.getAttributeNames();
String temp;
for (;e.hasMoreElements();){
  temp=(String)e.nextElement();
  out.print(temp+"="+(String)session.getAttribute(temp)+"<br>");
}
%>
</body>
</html>
原文地址:https://www.cnblogs.com/zhuor/p/397056.html