在servlet下转入页面response.sendRedirect,可是我用的是框架,转入的页面也在框架中,怎么才能转入他的页面充满整个页面~

解决方案 »

  1.   

    用java不行,用js吧,top.location.href="url 地址"
      

  2.   

    out.println("<script>window.location.href='a.jsp';</script>")
      

  3.   

    out.println("<script>if(window.top)window.top.location.href='a.jsp';else window.location.href='a.jsp'</script>")
      

  4.   

    我得意思是我转入servlet的页面在框架中,现在我再servlet下想转入另外一个页面,不想在这个框架下,想转入一个页面占满整个浏览器~但是我用servlet的response.sendRedirect()转向还是在这个框架中,因为我弄的是注销,返回页面应该是主页面,没有什么框架的。
      

  5.   

    AWUSOFT(如果可以了,请结贴,谢谢!) 的window,servlet不认,我试了,说window.location找到的为空或不为对象
      

  6.   

    supermanyan10() 在servlet里转页面在哪写target?不明白
      

  7.   

    哦!我明白了,你的意思是说你想实现框架中的退出,像用户注销一样
    用_blank吧,定向的时候不是有什么_top,_blank,_self吗,其中有一个可以实现你的情况
      

  8.   

    在哪写/?我要在servlet下,ymlb123(牛逼的人做牛逼的事)你说的我也知道,但是在servlet下怎么写么?
      

  9.   

    response.sendRedirect(request.getContextPath()+"/index.jsp"+"  target=_blank");报错:HTTP Status 404 - /session/index.jsp%20%20target=_blank
      

  10.   

    jeanissong() ( ) 在serlvet中怎么写?不好意思,新手
      

  11.   

    request.getRequestDispatcher("跳转页面").forward(request,response) ;
      

  12.   

    lqa222() ( ) 
    request.getRequestDispatcher("跳转页面").forward(request,response) ;
    还是不能脱离那个框架,我现在就是要脱离那个框架~在servlet下怎么写?有人知道吗?
      

  13.   


    我觉得你“注销”这个超链接指向的页面不对,JS我不熟,我觉得你可以<a href="#" onclick="closeme()">注销</a>
    js函数 closeme里面关闭浏览器,然后打开新窗口跳转到一个页面(比如a.jsp,然后自动跳转到你的servlet)你的servlet清session之类用户信息,之后再
    response.sendRedirect("注销后的显示页面");
    =====================================
    <head> 
    <script>
    function closeme(){
    window.parent.opener=null;
    window.parent.close();//关闭框架页
    window.open("你的servlet");//新窗口中访问servlet,显示注销后结果页面
    }
    </script>
        </head>
        <body>
        <a href="#" onclick="closeme()">注销</a> 
        </body> 
    这是我的笨方法
      

  14.   

    target=*,不就可以啦???怎么搞那么复杂啊。。
      

  15.   

    lz试试:
    response.getWriter("<script>window.parent.location.herf=\"aaa.jsp\";</script>");
      

  16.   

    target在servle下不起什么作用,servlet不能识别target,我郁闷,servlet也不能识别window.parent,我非常郁闷~~看来只能关了当前页面,再重新开了,大家有没有什么好的主意?
      

  17.   

    嘿嘿...刚刚找到答案,就像三楼那样,不过有些不同
    out.println( " <script> parent.location.href='XXX.jsp' </script> ");
    楼主试试!!