tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Brogden <wbrog...@bga.com>
Subject Re: servlet question !!!
Date Wed, 07 Jun 2000 15:14:17 GMT
You can't really get a separate set of class (static) variables
since there is only one JVM. You can get a separate set of
instance variables but the only way to ensure that each request 
gets a unique instance is to have your servlet class implement 
SingleThreadModel.
This is not recommended because it is slow. 
You need to re-think your design - if you want these variables
to stick around between request-response transactions maybe
you should attach them to a session object.

> Manpreet wrote:
> 
> Hi all,
> It may sound a bit out the way but can't find a better place to get
> an answer to this question.
> How can I assign a seperate set of class variables to each request
> that is being made to a servlet ??
> 
> thanks in advance,
> Manpreet Singh.

-- 
WBB - wbrogden@bga.com  Chief Scientist, LANWrights, Inc.
Java Programmer Certification information and mock exam
at  http://www.lanw.com/java/javacert/

Mime
View raw message