Print request details in JSP


/ Published in: HTML
Save to your folder(s)



Copy this code and paste it in your 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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.