by Dinesh Thakur Category: Servlet Chaining

The request object based RequestDispatcher object expects that the source servlet Program, destination web resource program and the destination web resource program be in the same web application.

The ServletContext object based RequestDispatcher object allows to keep the source servlet program and destination web resource program either in the same web application or in two different web application of the same server, but they cannot be two different web applications of two different servers.

         different web applications of two different servers

Here, we can use request object or ServletContext object basedRequestDispatcher Object.

         

Here Srv1 should use ServletContext object based RequestDispatcher object.

           servlet-servlet Communication

This kind of ServletChaining is not possible with RequestDispatcher object use send redirection concept. Servlet chaining is all about performing servlet-servlet communication.



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.