FileDocCategorySizeDatePackage
HeaderSnoop.javaAPI DocExample675Tue Jan 25 10:45:14 GMT 2000None

HeaderSnoop

public class HeaderSnoop extends HttpServlet

Fields Summary
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)

    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();

    out.println("Request Headers:");
    out.println();
    Enumeration enum = req.getHeaderNames();
    while (enum.hasMoreElements()) {
      String name = (String) enum.nextElement();
      String value = req.getHeader(name);
      if (value != null) {
        out.println(name + ": " + value);
      }
    }