Daniel de Almeida Alvares wrote:

> Hi all,
>
> Does anybody can help  me ?
> I'm trying to do a communication between servlets....
> one servlet calls public methods from other servlet !!!
> Is it possible ?
> Do u have any example ??
> I got the method .getServlet() deprecated...
> What should I user instead ????
>

There is no longer any mechanism anywhere in the servlet API that allows one
servlet instance to gain a reference to another servlet instance.

You should redesign your application logic so that shared logic (i.e. the method
that you need in more than one servlet) is created in a separate Java class.  A
couple of approaches to consider for sharing it:

* Store the shared object as a servlet context attribute, which
  is accessible to every servlet (and JSP page) in your app.

* Use static variables or methods -- they are directly accessible
  from all the classes in a web application.


>
> Regards
>
> Daniel
>

Craig McClanahan

___________________________________________________________________________
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