aspose file tools*
The moose likes JSP and the fly likes response.sendRedirect with time delay Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "response.sendRedirect with time delay" Watch "response.sendRedirect with time delay" New topic
Author

response.sendRedirect with time delay

Annemarie McKeown
Ranch Hand

Joined: Nov 07, 2003
Posts: 47
I am using response.sendRedirect(url) to direct a user another url after they have input some info in a form and clicked submit.
So on the process page of the form, I want to display something like the following before the user is redircetd to another page:
"Thanks for your details...we are taking you back to....."
With my code, the user is simply redirected to the (url) in question when they click on the submit button, and doesn't seen the text I want to display.

Note: Ive just realised it would be something like JavaRanch forums, after you submit a new post, the user is displayed: Sit tight we are taking you back to url; before the user is directed to that url.
Do you know how I would implement this?
[ March 31, 2004: Message edited by: Annemarie McKeown ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
JavaScript
goes to next page in 5 seconds
setTimeout("document.location.href='newPage.jsp'",5000);

Eric
damien malone
Ranch Hand

Joined: May 06, 2003
Posts: 35
alternatively you can try this
<html>
<head>
<META
http-equiv="refresh" content="5;URL=http://www.javaranch.com">
</head>
<body bgcolor="#ffffff">
<center>You will be redirected to javaranch automatically in 5 seconds.
</center>
</body>
</html>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: response.sendRedirect with time delay
 
Similar Threads
response.sendRedirect not working
How to stop user entering a record twice?
Is my code running twice? JSP, java beans, db updates - strange happenings
'POST'ing parameters to another JSP
Intermediate loading page