tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: HttpSession questions
Date Mon, 02 Jul 2007 00:36:35 GMT
> From: lightbulb432 [] 
> Subject: RE: HttpSession questions
> If however, I were to change my code and pass the return 
> value of Servlet's getServletContext() to my class, would
> a session still be created

No, no session is created.

> Out of curiosity, why is there a getServletContext() on 
> HttpSession?

You're not asking a Tomcat question here, but rather one that concerns
the servlet spec.  Such questions and comments should really be directed
to the appropriate JSR working group.

> But is there some design reason you can think of that the 
> method is in the session but not request object?

Requests have relatively short lifetimes, while sessions and contexts
typically exist orders of magnitude longer.  Since there's a trivial
solution to your problem, I don't think it's a big deal.

 - Chuck

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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

View raw message