setTimeout("window.location="nextjsp.jsp"","1000*n");
n为停留秒数

解决方案 »

  1.   

    <META HTTP-EQUIV="refresh" CONTENT="5;URL=\elearning\login.jsp"/>
    <meta http-equiv="Content-Language" content="zh-cn">
    <body>
    <div style="height:40px;padding:20px;filter:dropshadow(color=#cddded,offx=2,offy=2,positive=1);font:bold 12px fixedsys;color:#4090e4">Loading please wait...</div>
    </body>content="5 即为停5秒
      

  2.   

    <meta http-equiv="refresh" content="3;URL=aaa.htm">
      

  3.   

    谢谢longlink and www203!!zhaoxichao 
    我按你的方法试了但是不行,以下是我的代码,请指正!<html>
    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <title>用户登陆</title>
    </head>
    <body bgcolor="#ffcc33">
    <%@ page language="java"  import="java.sql.*" %>
    <jsp:useBean id="LoginBean" scope="page" class="library.Library" />
    <%
    String status=null;
    String name=request.getParameter("name");
    String password=request.getParameter("password");
    String sql="select * from user where name='" + name + "' and  password='" + password + "'";
    ResultSet rs =LoginBean.executeQuery(sql);
    if(rs.next()){
    status=rs.getString("status");
    rs.close();
    session.putValue("name",name);
    session.putValue("status",status);
    %>
    <p>欢迎您,<%=name%>!</p>
    <script language="javascritp">
    setTimeout("window.location="library_index.jsp"","1000*1");
    </script>
    <%
    }
    else{
    rs.close();
    session.putValue("login_message","Error in login!");
    %>
    <p>登陆失败,请重试!</p>
    <input type="button" value="返回修改"  onclick="history.back()">
    <%
    }
    %></body>
    </html>
      

  4.   

    改成
    <SCRIPT LANGUAGE="JavaScript">
      setTimeout("location='library_index.jsp'", 5000);
    </SCRIPT>
    建议看看
    http://www.fawcette.com/china/print.aspx?TotalPage=3&ID=59