Posted By

mindhaq on 11/18/10


Tagged

debug request JSP servlet


Versions (?)

Print all ServletRequest attributes in a JSP page


 / Published in: Java
 

  1. <pre>
  2. <%
  3.  
  4. for (Enumeration<String> enumeration = request.getAttributeNames(); enumeration.hasMoreElements();) {
  5. String attributeName = enumeration.nextElement();
  6. Object attribute = request.getAttribute(attributeName);
  7. out.println(attributeName + " -> " + attribute.getClass().getName() + ":" + attribute.toString());
  8. }
  9.  
  10. %>
  11. </pre>

Report this snippet  

You need to login to post a comment.