Hi Everybody,
I am learning sessions in servlet. I am using "Resin" webserver.
To understand the session context object I am executing folloing code.
==== Code====
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
// Get the current session object, create one if necessary
HttpSession dummySession = req.getSession(true);
// Use the session to get the session context
HttpSessionContext context=dummySession.getSessionContext();
Enumeration ids = context.getIds();
==== Code ends===
I am getting null pointer exception on the last statement(i.e. Enumeration ids = context.getIds()
. So I came to know that getSessionContext function is not returing a session context object. What I am doing wrong? I will appreciate anybody's help in this regard.
Thanks,
Srikanth.