Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

list all session variables

 
scottie zman
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone post some code to loop through all session variables and display their values?
thanks
Zman
 
Manjunath Reddy
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enumeration e = session.getAttributeNames();
while ( e.hasMoreElements() )
{
String key = (String)e.nextElement();
out.println( key + " = " + session.getAttribute( key ) + " <br>" );
}
mpr
 
scottie zman
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a bazillion.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic