Please... help me. With asp, you can print your session or request object contents with the following code:
For those of you that aren't familiar with asp, the resulting output would be something like: NameOfSessionVariable1 = ValueOfSessionVariable1 NameOfSessionVariable2 = ValueOfSessionVariable2 NameOfSessionVariable3 = ValueOfSessionVariable3 How is this done with jsp? Thanks.
The session object has a method named getAttributeNames(), which returns an enumeration of the names of all objects bound to the session. You can loop through the enumerated names and retrieve the session values with session.getAttribute(name): Enumeration names = session.getAttributeNames(); while (names.hasMoreElements()) { String name = (String) names.nextElement(); Object value = session.getAttribute(name); } Here is an example of the technique that uses a table to print the retrieved attributes:
Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>