• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with session context.(Urgent)

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am guessing here..
change it o req.getParameter("sessionid") and try
Beksy
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic