File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Redirecting from one server to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Redirecting from one server to another" Watch "Redirecting from one server to another" New topic
Author

Redirecting from one server to another

Sajee Joseph
Ranch Hand

Joined: Jan 17, 2001
Posts: 200
Hello all,

I have a situation in which i need to redirect a request from a server to another server. Like i have a link 'Application2' which takes the user on one application to 'Application2'. How can do that in the following cases:

1. When the Source is an HTTP server and destination is an HTTP server too
2. When the Source is an HTTP server and destination is an HTTPS server
3. When the Source is an HTTPS server and destination is an HTTP server
4. When the Source is an HTTPS server and destination is an HTTPS server too

What are the configurations to be done in each of the cases? If the configuration is specific to the app server, then please explain in terms of Tomcat servlet engine

Regard,
sajee
Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi,
The redirecting of a request will behave as follows

1. When the Source is an HTTP server and destination is an HTTP server too
THIS WILL NOT BE A PROBLEM, YOU CAN USE JUST REDIRECT THE RESPONSE TO THE REQUIRED SERVER
2. When the Source is an HTTP server and destination is an HTTPS server
THIS WILL GIVE YOU A FORBIDDEN ERROR BECAUSE YOU ARE GOING FROM A INSECURE LINK TO SECURE LINK
3. When the Source is an HTTPS server and destination is an HTTP server
THIS WILL NOT BE A PROBLEM, YOU CAN USE JUST REDIRECT THE RESPONSE TO THE REQUIRED SERVER BECAUSE THIS IS GOING FROM SECURE TO INSECURE
4. When the Source is an HTTPS server and destination is an HTTPS server too
THIS WILL NOT BE A PROBLEM

I am not sure exactly what configuration to do in Tomcat, the point 2 is to do with the SSL configuration I guess.

Regards,
Sivaraman.L
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirecting from one server to another