maya:
as long as both servlets run in the same context i.e. same directory setup
during tomcat (servlet container) startup, they will be considered part of
the same web application.
hope this clarifies.
----- Original Message -----
From: "Maya Vayner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 15, 2001 23:34
Subject: Re: Context Attributes.
> Quick question:
> What are we calling "the same web application"? If we
> have an online store that uses MyCart and MyOrder
> servlets, are these two servlets in "the same web
> application" then?
> Thanks.
> Maya
> --- "Christopher K. St. John" <[EMAIL PROTECTED]>
> wrote:
> > Kumar Majji wrote:
> > >
> > > Can anyone explain this to me? Specifically, this
> > > sentence: "A servlet can bind an object attribute
> > > into the context by name".
> > >
> >
> > Imagine you've got two servlets in your web
> > application,
> > and that they need to share some information. Since
> > they're part of the same web application, they will
> > share a servlet context. The servlet context has a
> > data structure that maps Strings to Objects, just
> > like
> > a Hashtable. You can add ('bind') new objects to the
> > servlet context using the setAttribute call, and
> > retrieve them using getAttribute. So one servlet can
> > add an object to the context, and another servlet in
> > the same webapp can retrieve it[1]
> >
> > The spec is a very valuable source of information,
> > but
> > if you're having trouble with explanactions like the
> > above, then you might want to consider investing in
> > a good servlet book (see the archives for
> > recommendations)
> > All the info is in the spec and online, but you can't
> > beat a good book if you want clearly worded
> > explanations.
> >
> >
> > [1] Well, more or less. Things are more complicated
> > if
> > the webapp is distributed, but you can safely ignore
> > that for the moment.
> >
> > --
> > Christopher St. John [EMAIL PROTECTED]
> > DistribuTopia http://www.distributopia.com
> >
> >
>
___________________________________________________________________________
> > 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
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
>
___________________________________________________________________________
> 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
___________________________________________________________________________
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