tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Vanderfluit <l...@chipcity.com.au>
Subject Re: config 302 redirect ?
Date Thu, 27 Nov 2003 19:38:22 GMT
Hi P.,

There are a number of ways:
1. using the "Refresh" header,
2. using the "Location" header,

these you can do using META tags
as in 
<meta http-equiv="Refresh" Content="3;http://mydomain.com/gohere"

or using the servlet API as in
response.setHeader("Refresh", "3;http://mydomain.com/gohere");
response.setHeader("Location", "http://mydomain.com/gohere");
response.sendRedirect("http://mydomain.com/gohere");

or when redirecting to another resource you can do:
ServletContext context = getServletContext();
RequestDispatcher rd =
   context.getRequestDispatcher("otherServletOrJSPOrHtml");
rd.forward(request, response);

hope this helps,

kind regards,
Luke

On Fri, 2003-11-28 at 01:10, P.vanKemenade wrote:
> Hi
> 
> what is the correct way to redirect users to a completely different
> server when they try to acces some address ? I'm looking for a
> config option (in server.xml or web.xml) that will return a http
> redirect header, like apache's Redirect directive.
> 
> when people ask for
> 	http://mydomain.com/gohere/
> or
> 	http://mydomain.com/gohere/bla/bla
> 
> I want them to go
> 	http://yourdomain.com/gosomewhereelse
> and
> 	http://yourdomain.com/gosomewhereelse
> 
> thanks,
> *pike
> ============
> "I wasted time, and now doth time waste me"
> 
> http://framework.v2.nl/archive/archive/node/text/default.py/nodenr-67731
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
-- 
====================================
"when my computer smiles, I'm happy"
===============================.~ ~,
Luke Vanderfluit               |'/']
Mobile: 0421 276 282            \~/`


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message