That isn't strictly true.  You can call the [static/class] methods of
another servlet (though it's not recommended).  Just import the servlet as
you would any class (this is the tricky part), then call the static method
as you would normally.  This approach won't likely work with instance
methods.

Lance Lavandowska
Software Engineer
http://www.AgDomain.Com

-----Original Message-----
From: Nic Ferrier <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, September 08, 1999 6:06 AM
Subject: Re: how to call other servlet's method


>>>> Lomesh Contractor <[EMAIL PROTECTED]> 9/8/99 10:37:55 AM >>>
>>            I want to know how can i call other servlet's method ?
>
>
>If you mean:
>"how can one servlet call a method in another servlet?"
>
>You can't. Servlets can only communicate with each other through the
>servlet engine.
>See below.
>(you could if the method was public static but that's not what you
>mean I suspect).
>
>
>
>If you mean:
>"how can one servlet call another?"
>
>You can use a RequestDispatcher or a URL.
>
>eg with RequestDispatcher:
>
>  //some code in a servlet
>  RequestDispatcher
>rd=getContext().getRequestDispatcher("/2ndservletpath");
>  rd.forward(request,response);
>
>
>
>Hope this helps but I'm not exactly sure what you mean.
>
>
>
>
>Nic Ferrier
>Tapsell-Ferrier Limited
>http://www.tapsellferrier.co.uk
>
>"Use Ockham Luke"
>
>_________________________________________________________________________
__
>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

Reply via email to