您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> jsp编程 >> 正文

讲解jsp中的所有session

作者:佚名    责任编辑:admin    更新时间:2022-06-22

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="java.util.*"%>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  6. <title>无标题文档</title>
  7. </head>
  8. <body>
  9. <%
  10. Enumeration e=session.getAttributeNames();
     
  11. String temp;
     
  12. for (;e.hasMoreElements();){
     
  13.   temp=(String)e.nextElement();
     
  14.   out.print(temp+"="+(String)session.getAttribute(temp)+"<br>");
     
  15. }
  16. %>
  17. </body>
  18. </html>