- Get link
- X
- Other Apps
import java.io.*; import java.servlet.*; import javax.servlet.*; public class RequestHeaderExample extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); Enumeration e = req.getHeaderNames(); while (e.hasMoreElements()) { String name = (String)e.nextElement(); String value = req.getHeader(name); out.println(name + " = " + value); } } }
Comments