0

我有一个使用框架集的页面。

顶部框架 = 标题信息(如注销、登录用户信息等) 左框架 = 菜单项 中心框架 = 相应点击菜单的数据页面

我的问题是当我尝试从应用程序中注销The logout functionalist is called in header section并且它也可以找到但其他框架没有关闭时。

如何克服这个:

这是带有表单集的整体设计

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>
<%
    String resourcePath = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="favicon.ico">
<title>SecureEyes - Infusing Security</title>
<script language="javascript" type="text/javascript" src="<%=resourcePath%>/scripts/frameset.js"></script>
<script language="javascript" type="text/javascript" src="<%=resourcePath%>/scripts/commonForHomePageTemplate.js"></script>
<script language="javascript">
<!--
var opt_no_frames = false;
var opt_integrated_mode = false;
var _help_prefix = "";
var _help_module = "";
var _context = "";
//-->
</script>
</head>

            <frameset border="0" frameborder="0" framespacing="0" rows="64,*">
                <form method="post" >

                    <frame border="0" frameborder="0" framespacing="0" id="topFrame" name="topFrame" src="<%=resourcePath%>/common/header.jsp" marginheight="0" marginwidth="0" noresize="noresize" scrolling="no">
                    <frameset border="0" frameborder="0" framespacing="0" id="MainFrameSet" cols="209,*">
                            <frame noresize="noresize" border="0" frameborder="0" framespacing="0" id="leftFrame" name="leftFrame" src="<%=resourcePath%>/common/left_menu.jsp" >
                            <frame border="0" frameborder="0" framespacing="0" id="workFrame" name="workFrame" src="<%=resourcePath%>/common/WelcomePage.jsp" marginheight="7" marginwidth="7" noresize="noresize" scrolling="auto">
                    </frameset>
                     <input type="hidden" id="method" name="method" />
                </form> 
            </frameset>
</html>

这是我有注销功能的地方:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>
<%@page  import="com.secureyes.eswastha.struts.viewmodel.UserViewModel"%>
<%
    String resourcePath = request.getContextPath();
    UserViewModel userVM = new  UserViewModel();
    if(session.getAttribute("userDetails")!=null){
        userVM = (UserViewModel) session.getAttribute("userDetails");
    }
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="shortcut icon" href="https://indedev.com:8443/favicon.ico">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script language="javascript" type="text/javascript" src="<%=resourcePath%>/scripts/commonForHomePageTemplate.js"></script>
        <script language="javascript" type="text/javascript" src="<%=resourcePath%>/header_data/prototype.js"></script>
        <script language="javascript" type="text/javascript" src="<%=resourcePath%>/header_data/tooltip.js"></script>

        <link rel="stylesheet" type="text/css" href="<%=resourcePath%>/header_data/general.css">
        <link rel="stylesheet" type="text/css" href="<%=resourcePath%>/header_data/custom.css">
        <link rel="stylesheet" type="text/css" href="<%=resourcePath%>/header_data/layout.css">
        <link rel="stylesheet" type="text/nonsense" href="<%=resourcePath%>/header_data/misc.css">

<script>
    var tooltip;
    var opt_no_frames = false;
    var opt_integrated_mode = false;

        function logOut(){
        top.close();
        document.forms[0].action="LogoutAction.htm";
        document.forms[0].method.value="loginPage";
        document.forms[0].submit();
    }
</script>
<script>
    history.forward();
</script>

</head>
<body onload="SetContext(''); " onunload="" id="topCP">
<div class="body">
    <form method="post"> 
    <table cellspacing="0" width="100%">
        <tbody>
            <tr>
                <td class="companyLogo"><span class="topLogo"><img src="<%=resourcePath%>/header_data/logo.png" name="logo" border="0" height="53"></span></td>
                <td>
                    <div id="topTxtBlock" class="withTopRightLogo">
                        <span id="topTxtLoggedInAs">Logged in as <b><%=userVM.getUsername()%></b></span>
                        <span id="topTxtMyAccount"><a class="tootlipObserved" name="" id="" href="#" onmouseover='tooltip.set(event, [{"type":"string","string":"View preferences of your control panel account."}]);' onmouseout="tooltip.hide();" >My account</a></span>
                        <span id="topTxtLogout"><a class="tootlipObserved" href="#" onclick='if (confirm("Are you sure you want to log out?")) logOut("logout"); return false;' onmouseover='tooltip.set(event, [{"type":"string","string":"Log out of eSwastha."}]);' onmouseout="tooltip.hide();">Log out</a></span>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
        <input type="hidden" id="method" name="method" />
    </form>
</div>
<div style="position: absolute; top: 14px; left: 1111px; display: none;" class="tooltip">View preferences of your control panel account.<br></div>
</body>
</html>

当我按下刷新时,一切都再次加载,那么如何使用javascript禁用刷新和后退功能?

4

1 回答 1

1

简单的答案:不要-使用-框架

于 2012-10-23T10:39:39.073 回答