How to refresh the jsp page after a given time(or interval)?

后端 未结 4 1225
遥遥无期
遥遥无期 2021-01-12 10:52

I would like to refresh/reload my jsp page after a certain time interval. Consider the time interval is of 5 minutes.

How can achieve it?

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 11:28

    In jsp add

    <%
      response.setIntHeader("Refresh", time_in_second); //in your case 60*5=300 (for 5 min)
    %>
    

    If you want to do it without using java code then Rahul Tripathi solution is the best as html tag will work perfectly in jsp.

提交回复
热议问题