How do I keep track of the session for each servlet request, until I use it? Singletons wont work?
- by corgrath
For each servlet request I get, I pass, perhaps, 10 methods before I am at where I need to check something in the session and I need the HttpSession.
The only way I can get the HttpSession is from the HttpServletRequest, correct?
How do I keep track of the session for each servlet request? Unfortuantly I cannot simple make a singleton (ex, SessionInformation.instance().getAttribute("name")) because that session would then be used over all requests.
Is there a way to store the session globally for each request without having to pass it (or it's information) down all the methods just in case I need it?