Possible Duplicate:
ServletContext and Session object
I am finding it strange that
session.getAttribute("someString");
works while
session.getServletContext().getAttribute("someString");
does not always work.
I am adding objects to session by getting HttpSession object from HttpServletRequest request with
request.getSession().setAttribute("someString")
Simple: the session is not the same thing as the servlet context. They are quite different concepts, and have different uses.
Cletus sums it up nicely: