<%@ page import="java.util.*" %> Snooper

Request Snooper


Query String:

<% out.println(request.getQueryString()); %>

Request Parameters:

NameValue <% Enumeration pnames = request.getParameterNames(); while (pnames.hasMoreElements()) { String name = (String) pnames.nextElement(); String values[] = request.getParameterValues(name); if (values != null) { for (int i = 0; i < values.length; i++) { %>
<%=name %>(<%=i %>)<%=values[i] %> <% } } } %>

Header Parameters:

NameValue <% Enumeration enum = request.getHeaderNames(); while (enum.hasMoreElements()) { String name = (String) enum.nextElement(); String value = request.getHeader(name); %>
<%=name %><%=value %> <% } %>

Sent Cookies :

<% javax.servlet.http.Cookie[] cookies = request.getCookies(); for (int c=0;c
Cookie[<%=c %>]
Name: <%=cookies[c].getName() %>
Value <%=cookies[c].getValue() %>
Domain: <%=cookies[c].getDomain() %>
Path: <%=cookies[c].getPath() %>
Secure: <%=cookies[c].getSecure() %>
Version: <%=cookies[c].getVersion() %>
MaxAge: <%=cookies[c].getMaxAge() %>
Comment: <%=cookies[c].getComment() %>
<% } %>

Client snoop:

request.getRemoteHost(): <%=request.getRemoteHost() %>
request.getRemoteAddr(): <%=request.getRemoteAddr() %>

Server snoop:

<% /* out.println("getServletContext().getServerInfo(): " + servlet.getServletContext().getServerInfo()); Enumeration atts=servlet.getServletContext().getAttributeNames(); while(atts.hasMoreElements()){ // informations supplémentaires du constructeur String att= (String)atts.nextElement(); out.println("getServletContext().getAttribute(\""+att+"\"): " + servlet.getServletContext().getAttribute(att); } */ %> request.getServerName(): <%=request.getServerName() %>
request.getServerPort(): <%= request.getServerPort() %>