Inter-servlet Communication

Applets loaded in the same Web page can communicate with each other using the AppletContext object. Similarly, on the server-side, the Java servlet specification enables servlets loaded in the same instance of the server to communicate with each other. This communication between servlets is possible by using the only object available in a servlet that allows it to interact with the servlet container, the ServletContext object. The ServletContext object provides methods to access and communicate with the other loaded servlets using the RequestDispatcher object.

So why would you want to communicate with another servlet? Servlets can be reused for their functionality, like any other Java class. For example, a servlet ...

Get Sams Teach Yourself BEA WebLogic Server 7.0™ in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.