`
maoyifa100
  • 浏览: 64406 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Javascript 页面跳转

 
阅读更多
<%@ 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 + "/";
%>

<!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>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="x-ua-compatible" content="ie=7" />
		<title>跳转页面</title>
	</head>
	<body>
<style type="text/css">
.error {
	background: url(<%=basePath%>framework/skin/img/error/error.jpg) 0 0 no-repeat;
	height: 281px;
	width: 462px;
	top: 15%;
	left: 30%;
	position: absolute;
	padding: 100px 90px 0 35px;
	overflow: hidden;
}

.errorCont {
	float: left;
	color: red;
	width: 350px;
	word-wrap: break-word;
}
.foltleft {
	float: left;
	line-height: 30px;
}
</style>
<!--检索结果-->
<div class="error">
	<div class="foltleft">
		<img src="<%=basePath%>framework/skin/img/error/errorIcon.jpg" />
	</div>
	<div class="errorCont">
		<br/><b>${redirectMsg}</b><br/><br/>
		<b>页面将在5秒钟后跳转,如果不能自动跳转,</b>
		<a id="a_url" href="${pageContext.request.contextPath}${redirectUrl}" class="font_red">请点击此链接</a><br />
		<span id="span_timer"></span>
 
	</div>
</div>
	<script type="text/javascript">
		(function() {
		var total = 5;
		var span_timer = document.getElementById("span_timer");
		span_timer.innerHTML = total;
		var timer = setInterval(function() {
			if (total <= 0) {
				location.href = document.getElementById("a_url").href;
				clearInterval(timer);
				timer = 0;
			} else span_timer.innerHTML = --total;
		}, 1000);
		})();
	</script>
</body>
</html>

 Action中跳转:

    @SuppressWarnings("unchecked")
    @Action(value = "save", results = { @Result(name = "success", type = "redirectAction", params = { "actionName", "findOrderDept", "namespace", "/sale/order", "custId", "${orderRecordDTO.custId}" }),
    @Result(name = "redirect", type = "dispatcher", location = "/sale/jsp/order/redirect.jsp") })
    @Transactional(propagation = Propagation.REQUIRED)
    public String save() {

            getRequest().setAttribute("redirectMsg", "保存失败,客户" + orderRecordDTO.getCustId() + "预存中的可用总金额小于下单价格!请先给客户充值再重新购买。");
            getRequest().setAttribute("redirectUrl", "/account/AccountEntering/saveAccountEnteringInit!saveAccountEnteringInit.action?acctRecordDTO.custId=" + orderRecordDTO.getCustId());
            return "redirect";
}
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics