aspose file tools*
The moose likes JSP and the fly likes  how to redirect users to another address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark " how to redirect users to another address " Watch " how to redirect users to another address " New topic
Author

how to redirect users to another address

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reading my post
I have a problem that i do not know how to resolve.
we had an application in an address like :
http://www.myweb.com/web2/ it is a dynamic application written in java .
now we move it to another server like : http://10.10.a.b/web2/
we need all people that come to the first address to be redirected to new address with the complete url for example if some one come to http://www.myweb.com/web2/register.jsp
we should be able to redirect him/her to http://10.10.a.b:8888/web2/register.jsp

what should i do now ? is there any way that i can do this ?
i am allowed to deploy a java web application to first address to do this , i mean i can deploy some java web application to http://www.myweb.com/web2/ to make this redirection possible.
does any one hav an idea ?

thanks
Scheepers de Bruin
Ranch Hand

Joined: Jul 19, 2005
Posts: 99
Write a servlet that is called when http://www.myweb.com/web2/ is requested, and in the doGet and doPost methods:

request.redirect("http://10.10.a.b/web2/");


We're doomed!!<br />Yay!!!<br />No that's bad Girr!!<br />Yay!!!
Rudy Rusli
Ranch Hand

Joined: Jun 01, 2006
Posts: 114
Or if you don't want to use java,
you just can use javascript:

In the <body> tag of the old page (http://www.myweb.com/web2/register.jsp) do this:
<script type="text/javascript">
window.location='http://10.10.a.b:8888/web2/register.jsp'
</script>

It will bring the user to the desired page.
Hope this helps.

- Rudy -
Rudy Rusli
Ranch Hand

Joined: Jun 01, 2006
Posts: 114
Or if you don't want to use java,
you just can use javascript:

In the <body> tag of the old page (http://www.myweb.com/web2/register.jsp) do this:


It will bring the user to the desired page.
Hope this helps.

- Rudy -
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to redirect users to another address