dientmUET
dientmUET

Reputation: 101

JSP How to view all session on server

I am a very newbie in JSP Dynamic Web, I have a small project that request input username for user and use HTTP session to store temporary. After user register, user will come to guest page which show the guests who are accessed the application. I must use only jsp

Please help what should I do? Anybody can give something idea to to to study? Thank you and sorry about my bad English!

Upvotes: 0

Views: 72

Answers (1)

steven35
steven35

Reputation: 4017

Enumeration names = session.getAttributeNames();
while (names.hasMoreElements())
{
    String val = (String)names.nextElement();
    System.out.println(val + " : " + session.getValue(val));
}

You can print all session names and values like this

this tutorial is quite useful

Upvotes: 1

Related Questions