aspose file tools*
The moose likes Servlets and the fly likes list all session variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "list all session variables" Watch "list all session variables" New topic
Author

list all session variables

scottie zman
Ranch Hand

Joined: Aug 08, 2001
Posts: 40
Can someone post some code to loop through all session variables and display their values?
thanks
Zman
Manjunath Reddy
Ranch Hand

Joined: Jul 26, 2001
Posts: 60
Enumeration e = session.getAttributeNames();
while ( e.hasMoreElements() )
{
String key = (String)e.nextElement();
out.println( key + " = " + session.getAttribute( key ) + " <br>" );
}
mpr
scottie zman
Ranch Hand

Joined: Aug 08, 2001
Posts: 40
thanks a bazillion.
 
 
subject: list all session variables