tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Hall <rfha...@yahoo.com>
Subject Re: Retrieve certain session data inside a servlet
Date Fri, 02 Jun 2006 08:55:18 GMT
--- Carlos Alonso Vega <losalo@unavarra.es> wrote:

> 
> I am trying to obtain data about a session inside a
> servlet, the code 
> seems to be simple as
> 
> localSession =
> Ctx.getManager().findSession(sessionId);
> 
> My problem is that I do not know how to obtain the
> Ctx object from a 
> request (HttpServletRequest)
> 
> Thanks in advance
> 

Carlos,

To obtain the HttpSession for the current request:

HttpSession sess = req.getSession();
    OR
boolean create = false;  (or true)
HttpSession sess = req.getSession(create);

HTH,
Bob

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message