Personally, I prefer to use good old JavaScript.... <HTML> <HEAD> </HEAD> <SCRIPT> <!-- START HIDE function jmp(){ document.location.href="http://www.Yahoo.com/" } // STOP HIDE --> </SCRIPT> <BODY onload="setTimeout('jmp()',2000)"> </BODY> </HTML> That's set for 2 seconds ------------------ C programmer gone astray
Yes, you can. You need to set it in the response.setHeader() Here is an example that loads the Google page after 20 seconds. response.setHeader("Refresh", "20; URL=http://www.google.com")
Thanx for your answers. The JavaScript stuff works fine but not for my case : the redirection link is not static but it is "calculated" inside a snippet (the page that contains the redirection does some kind of proccesseing and may be called from various pages. I want to redirect the user at the page he submitted the information). As soon as I know Javascript does not "see" Java variables declared in a JSP (the calculated link is a string). I tried the following : response.setHeader("Refresh", "2; URL=" + myLink) but the server said : org.apache.jasper.JasperException: Unable to compile class for JSP response.setHeader("Refresh", "2; URL=" + pageLink) Any further ideas? Tom.
[This message has been edited by Tom Diamond (edited October 16, 2001).]
Tom, if this ("Refresh", "2; URL=" + pageLink) is the exact way you had it, you are missing a closing quote. It should be ("Refresh", "2; URL=" + pageLink")