JSP Addressbook app for VIP Express (circa Jun 2002)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

52 lines
1.7 KiB

  1. <%! static String pageTitle = "Snoopy"; %>
  2. <%@ page info="test area" %>
  3. <%@ page import="java.util.Enumeration" %>
  4. <%@ include file="include/pageHeader.jsp" %>
  5. <body style="background-color: #f0f0f0">
  6. <div>
  7. <h1>Header And Session Snooper</h1>
  8. <h3>Header Contents:</h3>
  9. <p class="content">
  10. <%
  11. Enumeration header = request.getHeaderNames();
  12. while(header.hasMoreElements()) {
  13. String name = header.nextElement().toString();
  14. String value = request.getHeader(name);
  15. out.println(" " + name + " = " + value + " <br>");
  16. }
  17. %>
  18. <h3>Request Parameters:</h3>
  19. <p class="content">
  20. RemoteUser = <%= request.getRemoteUser() %> <br>
  21. SessionID from cookie: <%= request.isRequestedSessionIdFromCookie() %> <br>
  22. SessionID from URL: <%= request.isRequestedSessionIdFromURL() %> <br>
  23. <%
  24. Enumeration arglist = request.getParameterNames();
  25. while(arglist.hasMoreElements()) {
  26. String name = arglist.nextElement().toString();
  27. String value = request.getParameter(name);
  28. out.println(" " + name + " = " + value + " <br>");
  29. }
  30. %>
  31. <h3>Session Contents:</h3>
  32. <p class="content">
  33. sessionId: <%= session.getId()%> <br>
  34. maxInactiveInterval: <%= session.getMaxInactiveInterval() %> seconds <br>
  35. sessionAttributes: <br>
  36. <p class="list">
  37. <% Enumeration enum = session.getAttributeNames();
  38. while(enum.hasMoreElements()) {
  39. String attr = enum.nextElement().toString();
  40. String val = session.getAttribute(attr).toString();
  41. out.println(" " + attr + " = " + val + " <br>");
  42. }
  43. %>
  44. <hr>
  45. <form method=GET action="/endSession.jsp" class="center">
  46. <input type="submit" value="End Session"/>
  47. </form>
  48. </div>
  49. </body>
  50. </html>