• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Session using Mock object

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

session.setupGetAttribute("ENQ_Buyer","Buy");
request.setSession(session);

and i am retrieving it like this

session.getAttribute("ENQ_FundManager").toString();

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);
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!