Your users can click on links or form submit buttons, generated by your servlet, that will generate requests to the other servlet.
You can also use response.sendRedirect to suggest that the user's browser make a request to that servlet.
Note: If the other servlet is under a different domain, the user's browser will most likely warn them that the form, link, or redirect is attempting to take them to another domain. This is usually in the form of a gray popup window.
Originally posted by aman hindustani: i mean ..can i transfer my request and respose object ..to another servlet running in another domain...using RequestDispatcher..
no. Those are specific to not just the server but the web application within that server which received the original request.
42
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
posted
0
If you are calling for any web resource in another server context, you have become a client and must use client code to do it. You can use HttpClient from Apache Jakarta Commons to do it.