Posted By

ejboy on 04/08/11


Tagged

java JSP


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ejboy


Print request details in JSP


 / Published in: HTML
 

  1. <%@ page import="java.util.Enumeration"%>
  2. <%@ page import="java.util.Collections"%>
  3.  
  4. <title>Request details</title>
  5.  
  6. <pre>
  7. <%
  8. out.println(request.getRequestURL() + "?" + request.getQueryString());
  9. for(String h : Collections.list((Enumeration<String>)request.getHeaderNames())) {
  10. for(String v : Collections.list((Enumeration<String>)request.getHeaders(h))) {
  11. out.println(h+": "+v);
  12. }
  13. }
  14.  
  15. %>
  16. </pre>
  17. </body>
  18. </html>

Report this snippet  

You need to login to post a comment.