forwarding to a remote host
Hello list, I have a servlet that handles POST requests. Sometimes the request needs to be forwarded to a different servlet, which may be running on a different server. What is the best way to do that? Thanks, Zohar.
Re: forwarding to a remote host
not unless you've got clustering setup and the cluster is correctly sharing session data. the session data is otherwise local to the server in use. Vinu Varghese wrote: Avi, What will happen with the session and objects bound to it ?, Will they be accessible in the second server ? - Regards Vinu Avi Deitcher wrote: Zohar, - In the same host context, use RequestDispatcher.forward() - In the same host but different context, if cross-context enabled, get the RequestDispatcher for that context then use forward() - Different host entirely, or cross-context not enabled, you will probably need to rebuild the request. I usually use the Jakarta Commons HTTPClient for this. Check out http://jakarta.apache.org/commons/httpclient/ Anyone have a better suggestion? Avi Zohar wrote: Hello list, I have a servlet that handles POST requests. Sometimes the request needs to be forwarded to a different servlet, which may be running on a different server. What is the best way to do that? Thanks, Zohar. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: forwarding to a remote host
Hi Zohar Check this http://marc.theaimsgroup.com/?l=tomcat-userm=108568149602563w=2 http://marc.theaimsgroup.com/?l=tomcat-userm=108568149602563w=2 Hope this helps - Regards Vinu Zohar wrote: Hello list, I have a servlet that handles POST requests. Sometimes the request needs to be forwarded to a different servlet, which may be running on a different server. What is the best way to do that? Thanks, Zohar. -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org
Re: forwarding to a remote host
What's the easiest way to transfer all the data from the Request to the PostMethod? - Original Message - From: Avi Deitcher [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 14:38 Subject: Re: forwarding to a remote host Zohar, - In the same host context, use RequestDispatcher.forward() - In the same host but different context, if cross-context enabled, get the RequestDispatcher for that context then use forward() - Different host entirely, or cross-context not enabled, you will probably need to rebuild the request. I usually use the Jakarta Commons HTTPClient for this. Check out http://jakarta.apache.org/commons/httpclient/ Anyone have a better suggestion? Avi Zohar wrote: Hello list, I have a servlet that handles POST requests. Sometimes the request needs to be forwarded to a different servlet, which may be running on a different server. What is the best way to do that? Thanks, Zohar. -- __ Avi Deitcher [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]