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.
52 lines
1.7 KiB
52 lines
1.7 KiB
<%! static String pageTitle = "Snoopy"; %>
|
|
<%@ page info="test area" %>
|
|
<%@ page import="java.util.Enumeration" %>
|
|
<%@ include file="include/pageHeader.jsp" %>
|
|
<body style="background-color: #f0f0f0">
|
|
<div>
|
|
<h1>Header And Session Snooper</h1>
|
|
|
|
<h3>Header Contents:</h3>
|
|
<p class="content">
|
|
<%
|
|
Enumeration header = request.getHeaderNames();
|
|
while(header.hasMoreElements()) {
|
|
String name = header.nextElement().toString();
|
|
String value = request.getHeader(name);
|
|
out.println(" " + name + " = " + value + " <br>");
|
|
}
|
|
%>
|
|
<h3>Request Parameters:</h3>
|
|
<p class="content">
|
|
RemoteUser = <%= request.getRemoteUser() %> <br>
|
|
SessionID from cookie: <%= request.isRequestedSessionIdFromCookie() %> <br>
|
|
SessionID from URL: <%= request.isRequestedSessionIdFromURL() %> <br>
|
|
<%
|
|
Enumeration arglist = request.getParameterNames();
|
|
while(arglist.hasMoreElements()) {
|
|
String name = arglist.nextElement().toString();
|
|
String value = request.getParameter(name);
|
|
out.println(" " + name + " = " + value + " <br>");
|
|
}
|
|
%>
|
|
|
|
<h3>Session Contents:</h3>
|
|
<p class="content">
|
|
sessionId: <%= session.getId()%> <br>
|
|
maxInactiveInterval: <%= session.getMaxInactiveInterval() %> seconds <br>
|
|
sessionAttributes: <br>
|
|
<p class="list">
|
|
<% Enumeration enum = session.getAttributeNames();
|
|
while(enum.hasMoreElements()) {
|
|
String attr = enum.nextElement().toString();
|
|
String val = session.getAttribute(attr).toString();
|
|
out.println(" " + attr + " = " + val + " <br>");
|
|
}
|
|
%>
|
|
<hr>
|
|
<form method=GET action="/endSession.jsp" class="center">
|
|
<input type="submit" value="End Session"/>
|
|
</form>
|
|
</div>
|
|
</body>
|
|
</html>
|