getAttribute() in ServletContext is to share objects across servlets.  It does allow
you to share the servlets themselves but that doesn't mean that this was the reason
for this facility.  It is a side effect.  One way to disable putting servlets in
ServletContext is to have GenericServlet NOT extend Object, the other is to not
allow putting Objects in ServletContext.  Let's not do either :-)

I agree with others saying that if you need to call a method of one servlet from
another then your architecture is flawed.

d.

Ernie Varitimos wrote:

> It is simply not true that "the servlet model was not meant for such access".
> Otherwise the team at JavaSoft would not have provided the getAttribute() and
> setAttribute() methods in the ServletContext. They simply wanted to provide an
> architecture that made it easy to separate one servlet based application from
> another, yet still provide a means for servlets to communicate with one another.
>
> -ernie
>
> "Subrahmanyam A.V.B." wrote:
>
> > This has been discussed several times. Refer to the archives. FYI, the
> > servlet model is not meant for such access.
> >
> > Subrahmanyam
> >
> > arun prakash wrote:
> > >
> > > Hi !!,
> > >
> > >    I need some help out from u guys. How can i call a
> > > specific servlet method from another servlet. Any
> > > suggestion will be extremely helpful and a code would
> > > be the best way to help me out.
> > >
> > > Thanks in advance.
> > > arun prakash
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Talk to your friends online with Yahoo! Messenger.
> > > http://im.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
> >
> > --
> > ----------------------------------------------------------
> > Letting U=Universal, and given God=U and Unreason=U,
> >         Unreason=God                            --- Q.E.D.
> > Check me at http://www.Subrahmanyam.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

--
David Mossakowski              [EMAIL PROTECTED]
Programmer                           212.310.7275
Instinet Corporation

"I don't sit idly by, I'm planning a big surprise"

___________________________________________________________________________
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