This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
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")
Bosun
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Tom Diamond
Ranch Hand
Joined: May 10, 2001
Posts: 98
posted
0
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 Diamond
Ranch Hand
Joined: May 10, 2001
Posts: 98
posted
0
Anyone with an idea???
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
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")