萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> jsp編程 >> 講解jsp中的所有session

講解jsp中的所有session

  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>
copyright © 萬盛學電腦網 all rights reserved