Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to redirect

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone,
I have a querry. I have three pages first page where i enter the values and the third page is where i get the values. This second page i wanna use as a redirect page. I have seen in many pages where a page is launched which says that soon you will taken to so and so page. I tried to use sendRedirect. As i thought that will work. We have such thing working in javaranch site also. Can anyone help me and tell how shall i do this. Thanks in advance
abhinav
abhinav@comprointertech.com
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Abhinav,
try this..
response.sendRedirect("/abc/xyz/close.jsp");
return;
abc, xyz are the root/sub folders..
if you want to pass some parameters to close.jsp page use query string.
Best luck..
 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I maybe wrong, but I think , query string will work if the method in the form tag was "get", and NOT "post".
Bye,
Tualha Khan
 
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or, you can have the second page
return HTML code like the following:
<html>
<head><meta http-equiv="REFRESH" content="10; URL=close.jsp"></head>
<body>
Sit tight, we will take you to
close.jsp in 10 seconds.
</body>
</html>
The brower will display the message
and automatically fresh
to close.jsp after 10 seconds. You
can change to 0 if you want immediate
redirection.
 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you are using JSP use Forward tag. Check this atJSPInsider.
I forgot the syntax.
Arun
 
This tiny ad will self destruct in five seconds.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic