主要是在做session失效的跳转时,由于页面由好几个frame构成,默认情况下,跳转回login页面的时候,是在某一个frame中显示的,这样明显有问题
解决办法:
1、在登录页面login.jsp中,加一段脚本
-
<script type="text/javascript"> if(self.location!=top.location){ top.location.href=self.location.href; } </script>
2)
新建一个中间页面,如下:relogin.jsp
<html>
<head>
<title></title>
<script type="text/javascript">
window.top.location='<%=request.getContextPath()%>';
</script>
</head>
</html>
然后,在struts.xml里面配置一个全局结果:
<global-results>
<result name="relogin" >/relogin.jsp</result>
</global-results>
最后,在拦截器中跳转到这个全局结果