tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Alonso Vega <>
Subject Re: Retrieve certain session data inside a servlet
Date Fri, 02 Jun 2006 09:15:03 GMT

 Thanks for the reply. My problem is that the session info I need is not 
of the session that makes the request. I need to check other sessions in 
the same context.  I can use the request because it is in the same 
context, so the manager is the same.

This servlet is called internally from the app, and checks if some 
session exists. It is similar to the case of obtaining all active 
sessions from one context using the manager inside the servlet code 
(findSessions). If someone have this piece of code (or similar), it will 
serve me.



Bob Hall escribió:

>--- Carlos Alonso Vega <> wrote:
>>I am trying to obtain data about a session inside a
>>servlet, the code 
>>seems to be simple as
>>localSession =
>>My problem is that I do not know how to obtain the
>>Ctx object from a 
>>request (HttpServletRequest)
>>Thanks in advance
>To obtain the HttpSession for the current request:
>HttpSession sess = req.getSession();
>    OR
>boolean create = false;  (or true)
>HttpSession sess = req.getSession(create);

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message