• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to redirect

 
Abhinav Sharma
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • 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
 
Sandeep. Oza
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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..
 
Tualha Khan
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • 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
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • 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.
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you are using JSP use Forward tag. Check this atJSPInsider.
I forgot the syntax.
Arun
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!