• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

how to redirect users to another address

 
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/");
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 -
 
Smith Li
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 -
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic