Skip to content

Instantly share code, notes, and snippets.

@alvarow alvarow/print-headers.jsp
Last active Apr 26, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.