页面刷新:
有三种方法:
1,在html中设置:
<title>xxxxx</title>之後加入下面这一行即可! 
定时刷新:<META HTTP-EQUIV="Refresh" content="10; URL=http://自己的URL"> 
10代表刷新间隔2.jsp
<% response.setHeader("refresh","1"); %>
 每一秒刷新一次3.使用javascript:
<script language="javascript">
setTimeout("self.location.reload();",1000);
<script>
一秒一次

解决方案 »

  1.   

    <%@ page import="java.util.Date" %>
    <%@ page contentType="text/html;charset=GB2312" %>
    <html>
    <head>
    下面为程序代码:
    <title>定时刷新页面</title>
    </head>
    <body>
    <br>
    <b>当前时间为:</b>
    <%
    response.setHeader("refresh","10");
    %>
    <%
    out.println(new Date());
    %>
    </body>
    </html>
      

  2.   

    <?xml version = "1.0"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><!-- Fig. 10.1: clock.jsp --><html xmlns = "http://www.w3.org/1999/xhtml"><head>
       <meta http-equiv = "refresh" content = "60" />
     
       <title>A Simple JSP Example</title>   <style type = "text/css">
          .big { font-family: helvetica, arial, sans-serif;
                 font-weight: bold;
                 font-size: 2em; }
       </style>
    </head><body>
       <p class = "big">Simple JSP Example</p>   <table style = "border: 6px outset;">
          <tr>
             <td style = "background-color: black;">
                <p class = "big" style = "color: cyan;">               <!-- JSP expression to insert date/time -->
                   <%= new java.util.Date() %>            </p> 
             </td>
          </tr>
       </table>
    </body></html>
      

  3.   

      用meta标签就行了,简单的东西别搞复杂了~