gmahler5th
asked on
How to display ALL Request/Response headers in JSP
What JSP code would I use if I want ALL of the Request and Response headers to be displayed on the page? In other words, just looking to get a dump of all headers and to display them on the page for debugging. Running Apache, WebLogic and RHEL.
ASKER
I just want to see the code, so I can put it in a JSP and have them ALL display.
is it required to put Apache in Debug mode?
is it required to put Apache in Debug mode?
ASKER
For example, in ASP code I use the following. How would I do the same thing in JSP?
<% For Each item In Request.ServerVariables %>
<span class="bgcolorsmallcapsnob order"><%= item %></strong>: </span>
<span class="bodyfine"><%= Request.ServerVariables(it em) %></span><br /><br />
<% Next %>
<% For Each item In Request.ServerVariables %>
<span class="bgcolorsmallcapsnob
<span class="bodyfine"><%= Request.ServerVariables(it
<% Next %>
Personally i wouldn't alter the code, but just use a proxy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
CEH, it is specifically required to test authz rules on a URL, and I need the vars to be displayed on this page only.
MrCoffee, does that code also display the server variables such as header vars? I.e. just want to be sure that request.getParameter will have server variables, and not just URL parameters.
thanks.
MrCoffee, does that code also display the server variables such as header vars? I.e. just want to be sure that request.getParameter will have server variables, and not just URL parameters.
thanks.
ASKER
Wouldn't Enumeration e = request.getHeaderNames(); be the function to use, instead of enumeration of Params?
gmahler5th - you're right. I misread the request, and assumed that they wanted request parameters.
The same code, with getHeaderNames() and individual getHeader(pName) would get the header names and values.
The real answer is to look at the API and get the information you want from the HttpServletRequest:
http://java.sun.com/products/servlet/2.3/javadoc/index.html
The same code, with getHeaderNames() and individual getHeader(pName) would get the header names and values.
The real answer is to look at the API and get the information you want from the HttpServletRequest:
http://java.sun.com/products/servlet/2.3/javadoc/index.html
If you are using tomcat as web-container, you can use request dumper value.
More, http://tomcat.apache.org/tomcat-5.0-doc/config/valve.html
More, http://tomcat.apache.org/tomcat-5.0-doc/config/valve.html
For the response. You can use wget in debug mode
man wget