当前我有一个主页面,嵌套了两个iframe,用户登陆后,如果session过期,点击任何按钮弹出的页面都会嵌套到右边的iframe里面。
如图:
登陆后:
后来在提示过期的页面加了如下代码,点击返回登陆就可以直接跳到外面了。
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="s" uri="/struts-tags" %> <!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> <title>Untitled Document</title> <link rel="stylesheet" href="include/css/top.css" type="text/css"/> <script type="text/javascript"> if (top.location !== self.location) { top.location = self.location; } </script> </head> <body> <s:form action="" method="post" theme="simple"> <table width="303" border="0" cellspacing="3" cellpadding="0"> <tr> <td width="119" class="cont_font"> <s:text name="session_error"/> </td> </tr> <tr> <td colspan="2" class="cont_font"><br/> <s:url id="url" action="preView" includeParams="none"/> <s:a href="%{url}" targets="_parent"> <s:text name="back_login"/> </s:a> <br/> </td> </tr> </table> </s:form> </body> </html>
target |
|
在何处打开目标 URL。
|