In jsp page to realize the way to share jump

  • 2020-06-15 10:05:19
  • OfStack

1. Decrementing jumps per second


<script language=javascript> 
    function out(obj){ 
     var i = obj ; 
     if(i==0) 
     document.location.href="index.jsp"; 
    document.body.innerHTML = i; 
     i--; 
    setTimeout("out("+i+")",1000); 
  } 
 </script> 
 <body onload="out(5);"> 
</body>

2. Use the response.setHeader function

<%response.setHeader("Refresh","5;URL=...");%>

3. Use the meta tag

<META   HTTP-EQUIV="REFRESH"   CONTENT="2";url=xxxx.jsp">


JSP page to achieve automatic jump!
1. Automatic page refresh:

Add the following code < head > In the area


<meta http-equiv="refresh" content="5">

Note: content="5" is time control, indicating that the page is refreshed every 5 seconds.

2. Automatic page jump:

Add the following code < head > In the area


<meta http-equiv="refresh" content="1;url=index.jsp">

Note: content="1 "is the time control, indicating that the page to be redirected automatically after 1 second.
content="0 means to jump immediately to the page you want to jump to.
url= index. jsp is the page to jump to


Related articles: