页面定时刷新或自动跳转

采用response对象的setHeader方法可实现页面定时跳转或定时自刷新。

1.response.setHeaser("refresh","5");//每隔5秒,页面自刷新一次

2.response.setHeader("refresh","10;url=http://www.sohu.com");//延迟10秒后,自动重定向到页面http://www.sohu.com

time.jsp每间隔1秒,页面自动刷新,并在I页面上显示当前的时间。

原文地址:https://www.cnblogs.com/ljs-666/p/7637652.html