RE: How to redirect to a different host
You may have to use JSTL in your page. JSTL provides a tag called import that has the capability to import contents from other site to your page. So you may built a page that looks like %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % c:import url=http://shoppingcarthost:8080/shopping/ When the user requests webhost:8080/shopping use the response.sendRedirect() to direct to his request to this new page. This page will in turn post a request to a new container on a different machine. Don't forget to include JSTL jar files into your container. Vinod -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 2:58 PM To: Tomcat Users List Subject: How to redirect to a different host Is there anyway to configure Tomcat (without using apache) to redirect requests for a particular context to a new url (and host) Here's the scenario on the main page there is a link to a shopping cart context. This webapp does not run on this machine, it's running on a totally separate system, so what I want to do is: when the context webhost:8080/shopping is requested the request is redirected to shoppingcarthost:8080/shopping. Is it possible to do this in the server.xml file, or does it have to be done somewhere else. I know how to do this with apache, but using apache is not an option in this case. I need to know how to to do this independent of apache. Just using Tomcat configuration files. Thanks Daniel McMillan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: How to redirect to a different host Balancer Rules
Thanks for the Idea Vinod, unfortunately I don't have control of the jsp content, so that rather elegant solution won't work. However I'm definitely tucking that away in my mental rolodex. Thanks for the tip!!! Does anyone else know if there's a way to redirect to a different host I was looking at the balancer rules, and it looks like I might be able to use them, but I don't quite understand how to do this. The rule I need to develop is basically the requested URL of http://{webhost}:8080/shopping needs to be redirected to http://{shoppinghost}:8080/shopping. Anyone know how to do this? Original Message - From: Ramu, Vinod [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Date: Today 03:16:35 pm Subject: RE: How to redirect to a different host You may have to use JSTL in your page. JSTL provides a tag called import that has the capability to import contents from other site to your page. So you may built a page that looks like %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % c:import url=http://shoppingcarthost:8080/shopping/ When the user requests webhost:8080/shopping use the response.sendRedirect() to direct to his request to this new page. This page will in turn post a request to a new container on a different machine. Don't forget to include JSTL jar files into your container. Vinod - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to redirect to a different host
There is no way for Tomcat to do this 'out of the box'. But don't despair! Check out: http://www.zlatkovic.com/httpredirectfilter.en.html The author has released it under a very free license. I have been using the filter and can personally recommend it. The site seems to be down right now, so you'll have to check back later. Luke P.S. In the interest of full, squeaky clean disclosure, I've submitted a patch to the project. -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 14:58 To: Tomcat Users List Subject: How to redirect to a different host Is there anyway to configure Tomcat (without using apache) to redirect requests for a particular context to a new url (and host) Here's the scenario on the main page there is a link to a shopping cart context. This webapp does not run on this machine, it's running on a totally separate system, so what I want to do is: when the context webhost:8080/shopping is requested the request is redirected to shoppingcarthost:8080/shopping. Is it possible to do this in the server.xml file, or does it have to be done somewhere else. I know how to do this with apache, but using apache is not an option in this case. I need to know how to to do this independent of apache. Just using Tomcat configuration files. Thanks Daniel McMillan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] CONFIDENTIALITY NOTICE This e-mail and any attachments, as well as any documents from a file server of International Truck and Engine Corporation or its affiliates, are intended for the addressee and may contain information that is privileged, confidential, proprietary, or otherwise protected by law. Any dissemination, distribution, or copying is prohibited. If a confidentiality or nondisclosure agreement exists between International and the recipient or the recipient's employer, this e-mail and any attachments hereto, as well as any documents from a file server of International Truck and Engine Corporation or its affiliates, this notice serves as marking as CONFIDENTIAL information of International Truck and Engine Corporation or its affiliates. If you have received this communication in error, please contact the original sender. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]