Jason Hunter wrote:

>
> One thing I miss with ServletContext.setAttribute() however is the
> ability to easily have different data kept per registered servlet
> name.  For example, with JWS if you have a counter servlet
> registered as "counter" and registered also as "howmany" you will
> have two instances created, one per name.  Maintaining a separate
> count for /servlet/counter and /servlet/howmany is trivial -- just
> use instance variables to keep the count.
>

Jason, I should have been a little more precise.  In fact, if you alias the
same servlet class name to two different aliases in Apache JServ, you do get
two instances -- one per alias.  This is needed, because the lifecycles of
each instance are managed individually  Your "counter in an instance variable"
then works the way you want, if the servlet engine does not distribute the
same alias across multiple servers, or create multiple instances for some
other reason.

> -jh-
>

Craig McClanahan

___________________________________________________________________________
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

Reply via email to