table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Other HTTP Headers")
.attribute("COLSPAN", "2")
.left();
Enumeration h= request.getHeaderNames();
String name;
while (h.hasMoreElements())
{
name= (String)h.nextElement();
Enumeration h2= request.getHeaders(name);
while (h2.hasMoreElements())
{
String hv= (String)h2.nextElement();
table.newRow();
table.addHeading(name + ": ").cell().right();
table.addCell(hv);
}
}
table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Request Parameters")
.attribute("COLSPAN", "2")
.left();
h= request.getParameterNames();
while (h.hasMoreElements())
{
name= (String)h.nextElement();
table.newRow();
table.addHeading(name + ": ").cell().right();
table.addCell(request.getParameter(name));
String[] values= request.getParameterValues(name);
if (values == null)
{
table.newRow();
table.addHeading(name + " Values: ").cell().right();
table.addCell("NULL!!!!!!!!!");
}
else
if (values.length > 1)
{
for (int i= 0; i < values.length; i++)
{
table.newRow();
table.addHeading(name + "[" + i + "]: ").cell().right();
table.addCell(values[i]);
}
}
}
table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Cookies")
.attribute("COLSPAN", "2")
.left();
Cookie[] cookies = request.getCookies();
for (int i=0; cookies!=null && i<cookies.length;i++)
{
Cookie cookie = cookies[i];
table.newRow();
table.addHeading(cookie.getName() + ": ").cell().attribute("VALIGN", "TOP").right();
table.addCell(cookie.getValue());
}
/* ------------------------------------------------------------ */
table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Request Attributes")
.attribute("COLSPAN", "2")
.left();
Enumeration a= request.getAttributeNames();
while (a.hasMoreElements())
{
name= (String)a.nextElement();
table.newRow();
table.addHeading(name + ": ").cell().attribute("VALIGN", "TOP").right();
table.addCell("<pre>" + toString(request.getAttribute(name)) + "</pre>");
}
/* ------------------------------------------------------------ */
table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Servlet InitParameters")
.attribute("COLSPAN", "2")
.left();
a= getInitParameterNames();
while (a.hasMoreElements())
{
name= (String)a.nextElement();
table.newRow();
table.addHeading(name + ": ").cell().attribute("VALIGN", "TOP").right();
table.addCell("<pre>" + toString(getInitParameter(name)) + "</pre>");
}
table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Context InitParameters")
.attribute("COLSPAN", "2")
.left();
a= getServletContext().getInitParameterNames();
while (a.hasMoreElements())
{
name= (String)a.nextElement();
table.newRow();
table.addHeading(name + ": ").cell().attribute("VALIGN", "TOP").right();
table.addCell("<pre>" + toString(getServletContext().getInitParameter(name)) + "</pre>");
}
table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Context Attributes")
.attribute("COLSPAN", "2")
.left();
a= getServletContext().getAttributeNames();
while (a.hasMoreElements())
{
name= (String)a.nextElement();
table.newRow();
table.addHeading(name + ": ").cell().attribute("VALIGN", "TOP").right();
table.addCell("<pre>" + toString(getServletContext().getAttribute(name)) + "</pre>");
}
if (request.getContentType() != null
&& request.getContentType().startsWith("multipart/form-data")
&& request.getContentLength() < 1000000)
{
MultiPartRequest multi= new MultiPartRequest(request);
String[] parts= multi.getPartNames();
table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Multi-part content")
.attribute("COLSPAN", "2")
.left();
for (int p= 0; p < parts.length; p++)
{
name= parts[p];
table.newRow();
table.addHeading(name + ": ").cell().attribute("VALIGN", "TOP").right();
table.addCell("<pre>" + multi.getString(parts[p]) + "</pre>");
}
}
String res= request.getParameter("resource");
if (res != null && res.length() > 0)
{
table.newRow();
table
.newHeading()
.cell()
.nest(new Font(2, true))
.add("<BR>Get Resource: " + res)
.attribute("COLSPAN", "2")
.left();
table.newRow();