许多后台页面都会用到框架结构,在前台点击注销后,通常只是页面的主部分退出,造成了页面的重叠,若要实现整个页面的跳转,可用js完成:
<a href="javascript:void(0);" target="_blank" rel="external nofollow" id="exit">系统退出</a>
$("#exit").click(function(){
if (confirm("您确定要退出系统吗?")){
parent.window.location = "login.html";
}
});
而在后台,需要用过滤器检测用户的状态,session过期或者强制进入后台的话,将回到登录界面
后台过滤器代码:
HttpServletResponse httpServletResponse = (HttpServletResponse) response;
httpServletResponse.getWriter().print("<script>parent.window.location.href='nav?id=1'</script>");