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

iframe里在top窗口跳转到登录页

阅读更多

 

一、java实现

权限filter里加入

PrintWriter out = response.getWriter();
out.write("<script>top.location.href='"+request.getContextPath() + "/login"+"'</script>");

 此种方法有一个优点,不用向服务器请求两次login页面

 

二、js实现

在login页面加入

<script type="text/javascript">
	if (window != top)
	top.location.href = location.href;
</script>

 此种方法有一个缺点,得请求两次login页面

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics