Skip to content

Instantly share code, notes, and snippets.

@alvarow
Last active April 10, 2020 20:13
Show Gist options
  • Save alvarow/cc2852acc7439141be71 to your computer and use it in GitHub Desktop.
Save alvarow/cc2852acc7439141be71 to your computer and use it in GitHub Desktop.
Print HTTP request headers in JSP
<%@ page import="java.util.*" %>
<html>
<head>
<title>Http Request Headers Example in JSP</title>
</head>
<body>
<h2>HTTP Request Headers Received</h2>
<table>
<% Enumeration enumeration = request.getHeaderNames(); while (enumeration.hasMoreElements()) { String name=(String) enumeration.nextElement(); String value = request.getHeader(name); %>
<tr>
<td>
<%=n ame %>
</td>
<td>
<%=v alue %>
</td>
</tr>
<% } %>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment