File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Problem with session context.(Urgent) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with session context.(Urgent)" Watch "Problem with session context.(Urgent)" New topic

Problem with session context.(Urgent)

niranjan pulipati

Joined: Jul 04, 2001
Posts: 4
I have a 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
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
I am guessing here..
change it o req.getParameter("sessionid") and try
Micah Kornfield

Joined: Jul 23, 2001
Posts: 8
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.

God help us if computers ever unite against us<BR>When computers get together to make decisions, they form a Beowulf cluster. When humans get together to make decisions, they form a comittee. Need I say more?<P>-- archnerd on slashdot
Sam Dalton
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
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.

<a href="" target="_blank" rel="nofollow">Sam Dalton</a>,<br />Co-author of []Professional JSP 2.0[/URL] (October 2003)<br />Co-author of <a href="" target="_blank" rel="nofollow">Professional SCWCD Certification</a><br />Co-author of <a href="" target="_blank" rel="nofollow">Professional Java Servlets 2.3</a>
I agree. Here's the link:
subject: Problem with session context.(Urgent)
jQuery in Action, 3rd edition