• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Session using Mock object  RSS feed

amal benno
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am setting a session like in my mock object class


and i am retrieving it like this


This works fine. But i am not able to Enumeration of session values if more than one value is set in session. It returns null when i use this

Enumeration e = sc.getAttributeNames();

while (e.hasMoreElements())
String name = (String) e.nextElement();
String value = (String) session.getAttribute(name);
System.out.println("name--" + name + "-- value--" + value);
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!