On Sat, 5 May 2001, Brad Cox wrote:
> My first thought would be to save a reference in a static during the
> servlet init method.
My first thought would be to suggest really thinking about why you
(he) are wanting to do this and whether it's possible to modify the
design of the system such that it's not necessary to directly call the
methods of another servlet. For example, this is not a clean design,
and suggests that perhaps some methods should be moved out of the
servlet and into a separate "third party" non-servlet class. One way
to think about this is that servlets are just a web interface to an
application, not the application itself.
> At 11:22 AM -0700 05/05/2001, Manish Shah wrote:
> >hello everyone,
> >I did go through the RequestDispatcher but....how do I
> >get a direct reference to a servlet instance and call
> >its methods directly.
> >
> >Using the deprecated getServlet method it was done
> >this way...
> >myLogonApp = (AppLogonServlet)
> >getServletConfig().getServletContext().getServlet("mum_cs.AppLogonServlet");
> >
> >Please do let me know...or maybe if anyone knows some
> >piece of code which used the RequestDispatcher to do
> >this..or is it that it cant be done this way anymore
> >in the new API and the whole program logic itself has
> >to be changed...
> >I really appreciate any help...
> >
> >Manish
> >
> >ps. I am a little new to servlets....:)
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
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