Below is the JSP which can retrieve all the headers from the request and print it on the page.
<%
out.println("<ul>");
java.util.Enumeration names = request.getHeaderNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
String value = request.getHeader(name);
out.println(" <li> <b>" + name + "=</b>" + value +"</li>");
}
out.println("</ul>");
%>
<%
out.println("<ul>");
java.util.Enumeration names = request.getHeaderNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
String value = request.getHeader(name);
out.println(" <li> <b>" + name + "=</b>" + value +"</li>");
}
out.println("</ul>");
%>
Comments
Post a Comment