<%@ page import="javax.servlet.http.HttpUtils,java.util.Enumeration" %>

JSP Snoop page

Context information

Server Info: <%= application.getServerInfo() %>

Request information

Requested URL: <%= HttpUtils.getRequestURL(request) %>
Request method: <%= request.getMethod() %>
Request URI: <%= request.getRequestURI() %>
Request protocol: <%= request.getProtocol() %>
Servlet path: <%= request.getServletPath() %>
Path info: <%= request.getPathInfo() %>
Path translated: <%= request.getPathTranslated() %>
Query string: <%= request.getQueryString() %>
Content length: <%= request.getContentLength() %>
Content type: <%= request.getContentType() %>
Server name: <%= request.getServerName() %>
Server port: <%= request.getServerPort() %>
Remote user: <%= request.getRemoteUser() %>
Remote address: <%= request.getRemoteAddr() %>
Remote host: <%= request.getRemoteHost() %>
Authorization scheme: <%= request.getAuthType() %>
<% Enumeration e = request.getHeaderNames(); if(e != null && e.hasMoreElements()) { %>

Request headers

<% while(e.hasMoreElements()) { String k = (String) e.nextElement(); %> <% } %>
Header: Value:
<%= k %> <%= request.getHeader(k) %>
<% } %> <% e = request.getParameterNames(); if(e != null && e.hasMoreElements()) { %>

Request parameters

<% while(e.hasMoreElements()) { String k = (String) e.nextElement(); String val = request.getParameter(k); String vals[] = request.getParameterValues(k); %> <% } %>
Parameter: Value: Multiple values:
<%= k %> <%= val %> <% for(int i = 0; i < vals.length; i++) { if(i > 0) out.print("
"); out.print(vals[i]); } %>
<% } %> <% e = getServletConfig().getInitParameterNames(); if(e != null && e.hasMoreElements()) { %>

Init parameters

<% while(e.hasMoreElements()) { String k = (String) e.nextElement(); String val = getServletConfig().getInitParameter(k); %> <% } %>
Parameter: Value:
<%= k %> <%= val %>
<% // Attributes available from Jserv String prefix = "org.apache.jserv."; Object attrsObj = request.getAttribute("org.apache.jserv.attribute_names"); if ( attrsObj != null && attrsObj instanceof Enumeration ) { Enumeration attrs = (Enumeration) attrsObj; %>

JServ Attributes

available via HttpServletRequest.getAttribute()
<% while ( attrs.hasMoreElements()) { String attr = attrs.nextElement().toString(); %> <% } } %>
<% if ( request.getAttribute(prefix + attr) != null ) { out.println( prefix + attr + "" + request.getAttribute(prefix + attr).toString()); } else { out.println( prefix + attr + "NULL " ); } %>
<% } %>