%@page import="java.io.IOException"%>
<%@page import="java.util.Enumeration"%>
Snoop JSP
Init Parameters
<%
Enumeration e = getInitParameterNames();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
String value = getInitParameter(key);
%>--><%=key%> = <%=value%>
<%
}
%>
Context init parameters
<%
ServletContext context = getServletContext();
Enumeration myEnum = context.getInitParameterNames();
while (myEnum.hasMoreElements()) {
String key = (String) myEnum.nextElement();
Object value = context.getInitParameter(key);
%>--><%=key%> = <%=value%>
<%
}
%>
Context attributes
<%
myEnum = context.getAttributeNames();
while (myEnum.hasMoreElements()) {
String key = (String) myEnum.nextElement();
Object value = context.getAttribute(key);
%>--><%=key%> = <%=value%>
<%
}
%>
Request attributes
<%
e = request.getAttributeNames();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
Object value = request.getAttribute(key);
%>--><%=key%> = <%=value%>
<%
}
%>
General attributes
-->Servlet Name = <%=getServletName()%>
-->Protocol = <%=request.getProtocol()%>
-->Scheme = <%=request.getScheme()%>
-->Server Name = <%=request.getServerName()%>
-->Server Port = <%=request.getServerPort()%>
-->Server Info = <%=context.getServerInfo()%>
-->Remote Addr = <%=request.getRemoteAddr()%>
-->Remote Host = <%=request.getRemoteHost()%>
-->Character Encoding = <%=request.getCharacterEncoding()%>
-->Content Length = <%=request.getContentLength()%>
-->Content Type = <%=request.getContentType()%>
-->Locale = <%=request.getLocale()%>
-->Default Response Buffer: = <%=response.getBufferSize()%>
-->Request Is Secure = <%=request.isSecure()%>
-->Auth Type = <%=request.getAuthType()%>
-->HTTP Method = <%=request.getMethod()%>
-->Remote User = <%=request.getRemoteUser()%>
-->Request URI = <%=request.getRequestURI()%>
-->Context Path = <%=request.getContextPath()%>
-->Servlet Path = <%=request.getServletPath()%>
-->Path Info = <%=request.getPathInfo()%>
-->Path Trans = <%=request.getPathTranslated()%>
-->Query String = <%=request.getQueryString()%>
Parameter names in this request:
<% e = request.getParameterNames();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
String[] values = request.getParameterValues(key);
%>--><%=key%> = <%
for (int i = 0; i < values.length; i++) {
%><%=values[i]%> <%
}
%>
<%
}
%>
Headers in this request:
<%
e = request.getHeaderNames();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
String value = request.getHeader(key);
%>--><%=key%> = <%=value%>
<%
}
%>
Cookies in this request:
<%
Cookie[] cookies = request.getCookies();
if ( cookies != null ) {
for (int i = 0; i < cookies.length; i++) {
Cookie cookie = cookies[i];
%>--><%=cookie.getName()%> = <%=cookie.getValue()%>
<%
}
}
%>
Session Information:
<%
HttpSession ssession = request.getSession();
%>
-->Requested Session Id = <%=request.getRequestedSessionId()%>
-->Current Session Id = <%=session.getId()%>
-->Session Created Time = <%=session.getCreationTime()%>
-->Session Last Accessed Time = <%=session.getLastAccessedTime()%>
-->Session Max Inactive Interval Seconds = <%=session.getMaxInactiveInterval()%>
Session values:
<%
Enumeration names = ssession.getAttributeNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
%>
--><%=name%> = <%=session.getAttribute(name)%>
<%
}
%>