> >Class member variables CAN be used in servlets but must be used
carefully.
> >A valid use of them might be to have a class member variable as a request
> >counter for instance or
> >to record other state information for the servlet.
> >
>
> Even that is risky-we have multiple
> instances of the same servlet-just
> with different startup params.
> What's more, the server is free to
> destroy() your instance if it feels
> like it- after an idle timeout say- and create another instance
> later when a new request arrives.
>
Please note, I did say 'carefully'. Btw several instances of a servlet class
with different inits
are, if they are concurrently loaded, different objects therefore different
servlets.
How a developer deals with servlet state information when a servlet is
destroyed is also
a problem for them to solve.
Andy Bailey
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html