import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.Enumeration; public class PrintHeadersServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doIt(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doIt(request, response); } private void doIt(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Enumeration enum = request.getHeaderNames(); response.setContentType("text/html; charset=Shift_JIS"); PrintWriter out = response.getWriter(); out.println(""); out.println(""); out.println("ヘッダの一覧"); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); } }