response.sendRedirect() to different server
843840Apr 19 2002 — edited Jul 25 2002hi all,
I have a servlet running on one application server that process user login and redirect to another application server based on information retrieved in the servlet. I thought it'd be as simple as calling response.sendRedirect() with the URL of the redirect destination server - however it always end up being redirected to the same server.
For example, the login servlet is running on Server1, after login process is finished I want the servlet to redirect user to a servlet called TargetServlet on Server2. However after calling response.sendRedirect on Server1, the URL it redirects to is http://Server1/TargetServlet instead of http://Server2/TargetServlet. I know requestDispatcher.forward() can only be use within the same JVM. Does that apply to response.sendRedirect?
Thank you,
Makoto