<%! static String pageTitle = "Snoopy"; %> <%@ page info="test area" %> <%@ page import="java.util.Enumeration" %> <%@ include file="include/pageHeader.jsp" %>

Header And Session Snooper

Header Contents:

<% Enumeration header = request.getHeaderNames(); while(header.hasMoreElements()) { String name = header.nextElement().toString(); String value = request.getHeader(name); out.println(" " + name + " = " + value + "
"); } %>

Request Parameters:

RemoteUser = <%= request.getRemoteUser() %>
SessionID from cookie: <%= request.isRequestedSessionIdFromCookie() %>
SessionID from URL: <%= request.isRequestedSessionIdFromURL() %>
<% Enumeration arglist = request.getParameterNames(); while(arglist.hasMoreElements()) { String name = arglist.nextElement().toString(); String value = request.getParameter(name); out.println(" " + name + " = " + value + "
"); } %>

Session Contents:

sessionId: <%= session.getId()%>
maxInactiveInterval: <%= session.getMaxInactiveInterval() %> seconds
sessionAttributes:

<% Enumeration enum = session.getAttributeNames(); while(enum.hasMoreElements()) { String attr = enum.nextElement().toString(); String val = session.getAttribute(attr).toString(); out.println(" " + attr + " = " + val + "
"); } %>