Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何从servlet重定向到框架内的主页面?_Java_Jquery_Html_Jsp_Servlets - Fatal编程技术网

Java 如何从servlet重定向到框架内的主页面?

Java 如何从servlet重定向到框架内的主页面?,java,jquery,html,jsp,servlets,Java,Jquery,Html,Jsp,Servlets,我有3帧在屏幕上,使用帧集,我这样做 index.thml <frameset rows="75%,25%"> <frameset cols="20%,80%"> <frame src="TreeGroup.jsp" name="left" id="f1"/> <frame src="DisplayMap.jsp" name="top" id="f2"/> </frameset>

我有3帧在屏幕上,使用帧集,我这样做

index.thml

<frameset rows="75%,25%">
    <frameset cols="20%,80%">
        <frame src="TreeGroup.jsp" name="left" id="f1"/>
        <frame src="DisplayMap.jsp"   name="top" id="f2"/>
    </frameset>
    <frame src="Tabs.jsp" name="bottom"/>
 </frameset>
在f1帧中有一个链接,如果单击该链接,将在f2帧中打开VehicleReg。在f2帧中,我单击submit,控件转到Servlet,Servlet重定向到index.html。这是我面临的问题

在Servlet中,我执行response.sendRedirectindex.html


但在浏览器中,它已经在index.html中,在f2帧中的servlet响应之后,它将打开index.html。我的意思是它在f2帧中重定向index.html。如何避免这种情况。在servlet响应之后,我需要一个新的index.html。有人能帮我吗。

在index.html页面的标记之间添加以下JavaScript代码


这会使您的索引页自动脱离框架并重新加载自身。

框架已被弃用,您为什么要首先使用它们?使用表单上的目标解决您的问题
<script type="text/javascript" language="JavaScript">
    if (top.location != self.location) {
      top.location.href = self.location.href;
    }
</script>