错误地在frameset中显示登录页面,如下图:
为了避免上述情况出现,在登录页面采用如下js代码(参考):
<!-- 当session超时时,完全跳出frameset到登录页面 --> <script type="text/javascript"> if (top.location != self.location){ top.location=self.location; } </script>
我的项目实际需要js如下:
<!-- 当session超时时,完全跳出frameset到登录页面 --> <script type="text/javascript"> if (top.location != self.location){ top.location = "../main.jsp"; } </script>
因为main.jsp是我的项目登录之后要显示的页面框架。
此前我已经处理了登录路径过滤的问题,请参照:Filter
对未登录用户访问地址的控制