已知﹕index.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>gps</title>
</head>
<frameset rows="121,*" cols="*" frameborder="no" border="0" framespacing="0" >
  <frame src="top.jsp" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  <frameset cols="152,*" framespacing="0" frameborder="no" border="0" name="menu_main">
    <frame src="left.jsp" name="leftFrame" scrolling="no" noresize="noresize" id="leftFrame" title="leftFrame" />
    <frame src="sub_main.jsp" name="mainFrame" scrolling="yes" id="mainFrame" title="mainFrame" />
  </frameset>
</frameset>
</html>
在top.jsp中有个登陆功能,当登陆后top.jsp中有个退出按钮。
点击退出按钮时,页面回到当初打开index.jsp时的效果。
请问该如何实现?

解决方案 »

  1.   

    javascript document.parentWindow.location=index.jsp
      

  2.   

    document.parentWindow.location=一个servlet,处理了退出后再跳回index.jsp
      

  3.   

    用JS方法onclick="parent.window.frames['mainFrame'].location.href='sub_main.jsp'
      

  4.   

    用response.sendRedirect(“//绝对路径”);试试看能不能跳过去  我也遇到过这样的问题 用JS跳的话 好象只刷新FRAME区域 而不是整个页面 不知道这样跳能不能跳过去 没实验过 嘿嘿 如果可以告诉我一声哈 HOHO
      

  5.   

    用struts:mapping.findForward(String str);
    用Servlet:request.getRequestDispatcher()或response.sendRedirect()
    用jsp:<jsp:forward page="">
      

  6.   

    这个应该比较容易实现;
    设置那个退出按钮的onclick()事件,然后写一个 js函数就应该可以了。
      

  7.   

    to:tubage408 
    一定要用到到struts吗?
      

  8.   

    top.jsp中退出按钮的onclick="window.top.close();"
    显示你当前index.jsp的话是靠你的left.jsp中的选项对应的建议你好好看left.jsp里面是如何将index.jsp
    href过来的
      

  9.   

    to:newjavamaker 谢谢你的回复
    我要求的退出,不是关闭,
    而是回车,没登陆时的页面
      

  10.   

    window.top.location.href=" "用这个吧
      

  11.   

    直接用写一个javascrip代码window.location.href="url"就可以了
      

  12.   

    mapping.findForward(String str); 
    request.getRequestDispatcher()或response.sendRedirect() 
     <jsp:forward page="">
      

  13.   

    如果你是struts1那么可以用reset方法或者action的forward语句后面加个redirect=“true”   就可以了
    不然就window.location.href吧
    纯js我没那个本事- -|、
      

  14.   

    还是用 
    window.location.href="index.jsp"
    好一些。
      

  15.   

    用个隐藏页面,从Action跳出后转向隐藏页面.在隐藏页面里面用window(具体到index所在框).location.href="index.jsp" 脚本刷新即可.