Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with session context.(Urgent)

 
niranjan pulipati
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt..in sessioncontext..
i have few lines of code as
private HttpSessionContext m_SessionContext;
String sessionid= (String)req.getAttribute("sessionid");
m_SessionContext = req.getSession(true).getSessionContext();
HttpSession session1 = m_SessionContext .getSession(sessionid);

Here i am getting the "sessionid"from the jsp page.
when i run this code i am getting session as null.
why is it so..
Please help me..Urgent
Thanks & Regards
Niranjan
 
Beksy Kurian
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am guessing here..
change it o req.getParameter("sessionid") and try
Beksy
 
Micah Kornfield
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
another guess but was getSessionContext deprecated, i cannot recall but i though i might have it someplace and i also thought i read that it was redone to just return null when it was deprecated.
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getSessionContext() was indeed deprecated as of version 2.1 of the servlet spec. In fact the entire concept of the SessionContext was deprected (as well as the interface HttpSessionContext. What exactly do you want to do? There should be another way around this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic