Print all ServletRequest attributes in a JSP page


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



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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.