注册成功后,动态的设置3秒后页面跳转

jsp页面


<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
/* String path=request.getContextPath();
String basepath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/"; */
response.setHeader("refresh", "3;url=userSplist");


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%-- <base href="<%=basepath%>" /> --%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
#d1{
   height:40px;
   weight:800px;
   magin:auto;
   top:300px;
   background-color:green;
}
#tip,#s2{
       color:red;
       font-size:30px; 
    }
    a{
    magin:auto;
    }
</style>
<script type="text/javascript">
var i = 2 ;
var Interval = setInterval(function() {
document.getElementById("s2").innerHTML = i +"";
i--;
if (i==0) {
clearInterval(Interval);
//window.location="http://localhost:8080/ssm/main.jsp"; 
    //window.location="${url}"; 
}
},1000);

</script>
</head>
<body>
<h1>注册成功!!</h1>


<div id="d1">
<a href="${url }">立即跳转</a><br/>  //session.setAttribute("url", "login");
<span id="s1">${tip }</span> //session.setAttribute("tip", "注册成功");
<span id="s2">3</span>秒后自动跳转到登录页面
</div>


</body>
</html>

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值