File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlet-Servlet Communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet-Servlet Communication" Watch "Servlet-Servlet Communication" New topic

Servlet-Servlet Communication

Herbert Maosa
Ranch Hand

Joined: May 03, 2000
Posts: 289
I understand that you can get a servlet instance in the current context by invoking ServletConfig.getServletContext().getServlet("ServletName").
I however understand that beginning jdk1.2, this is not permitted anymore for among other things, security reasons. As such Servlets have to explicitly declare which attributes they want to export to the context, even be it the instance itself.
I would appreciate if anyone farmiliar with this new approach would educate me on the intricacies on how to do this.
Thanks in advance,
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
Deprecated. As of Java Servlet API 2.1, with no direct
This method was originally defined to retrieve a servlet from a
ServletContext. In this version, this method always returns null and
remains only to preserve binary compatibility. This method will be
permanently removed in a future version of the Java Servlet API.
In lieu of this method, servlets can share information using the
ServletContext class and can perform shared business logic by
invoking methods on common non-servlet classes.

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Herbert Maosa
Ranch Hand

Joined: May 03, 2000
Posts: 289
Thanks Tony.
I agree. Here's the link:
subject: Servlet-Servlet Communication
It's not a secret anymore!