• Post Reply Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect("") .. after time interval ..?

 
sarim raza
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upon submission of a user form through say form.jsp, the <form action = "processform.jsp"> .. takes the user to processform.jsp .. which prints out a success message ..
which i want the user to be able to read ....
and then the code
response.sendRedirect("index.html");
// takes user to home page ..
problem is .. the processform.jsp page does not have the chance to print out the success message since the redirection takes place immediately .. how can i delay this for a time interval .. say like 3 seconds or something ..
thanks
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The usual way I do this is to use an HTML "meta" redirect. Just output something like the following at the start of the page you wish them to see:
<meta http-equiv='refresh' content='2; url=whatever.jsp'>
This will wait two seconds, then fetch and show "whatever.jsp".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!