A web application follows the following directory structure:
\MyWebApplicationName
\web-inf\web.xml
\web-inf\classes
\web-inf\lib
Any html or jsp files you want directly accessible by a web client are
placed in the root directory (in this case under MyWebApplicationName).
Your two servlets (MyCart and MyOrder) would either be placed under
web-inf\classes or web-inf\lib (bundled as a zip or jar).
This directory hierarchy can then be deployed as is, or zipped into a
file ending with the .war extension. Once packaged as a web
application it can be deployed on any servlet 2.2 compliant or higher
servlet container.
-----Original Message-----
From: Wai Mun [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 15, 2001 5:45 PM
To: [EMAIL PROTECTED]
Subject: Re: Context Attributes.
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
___________________________________________________________________________
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