首页 > 开发 > JSP > 正文

列出jsp中的所有session

2020-02-05 13:34:13
字体:
来源:转载
供稿:网友


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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表