Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.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
Javascript 使用f5重新加载页面时限制确认消息_Javascript_Jsp_Browser_Spring Mvc - Fatal编程技术网

Javascript 使用f5重新加载页面时限制确认消息

Javascript 使用f5重新加载页面时限制确认消息,javascript,jsp,browser,spring-mvc,Javascript,Jsp,Browser,Spring Mvc,在我的JSP页面中,我在提交页面时使用post方法。 所以一旦我从第一页转到第二页。在第2页中,如果我按F5,我会得到如下警告: "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier." 我知道这个问题有点讽刺,但请给我一个想法。 我无法将我的方法从PO

在我的JSP页面中,我在提交页面时使用post方法。 所以一旦我从第一页转到第二页。在第2页中,如果我按F5,我会得到如下警告:

"To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier."
我知道这个问题有点讽刺,但请给我一个想法。 我无法将我的方法从POST更改为GET,因为我需要发送大量数据

先谢谢你

编辑: 在我的Page1.JSP中,我调用onClick函数,在该函数中,我将操作称为/page2servlet.do。 现在,在Java端,我使用Spring框架。使用MVC对象,我返回page2.jsp


那么response.sendRedirect适合哪里呢?

在发布后重定向到第2页。您将不再收到提示。

发布后重定向到第2页。您将不再收到提示。

完成POST后,保存会话所需的所有信息,并使用GET立即重定向到其他页面。然后在另一个页面上,从会话中获取所需的所有信息


但是,会话到期后,用户将无法按刷新。此外,它将打破多窗口。用户将无法在单独的窗口中进行两次不同的提交,因为他们将共享同一个会话对象。

完成POST后,保存会话所需的所有信息,并使用GET发送即时重定向到其他页面。然后在另一个页面上,从会话中获取所需的所有信息


但是,会话到期后,用户将无法按刷新。此外,它将打破多窗口。用户将无法在单独的窗口中进行两次不同的提交,因为它们将共享同一个会话对象。

以下是一个版本,可替换下一页:

-> redirect.php-> 谢谢

这里是redirect.php

<meta http-equiv="refresh" content="3; url=http://plungjan.name/test/thanks.html">
<script>
location.replace("http://plungjan.name/test/thanks.html");
</script>

redirecting..

.

以下是取代下一页的版本:

-> redirect.php-> 谢谢

这里是redirect.php

<meta http-equiv="refresh" content="3; url=http://plungjan.name/test/thanks.html">
<script>
location.replace("http://plungjan.name/test/thanks.html");
</script>

redirecting..

.

对不起,我不明白什么是重定向。在我的页面onClick中,我调用一个函数,并在其中调用表单submit;处理提交后,使用response.sendRedirectpage2.jsp;对不起,Alex,我想我的问题不清楚,请检查更新的,让我知道这适合哪里。谢谢。我想这正是你需要的:对不起,我不明白你想要什么。在我的页面onClick中,我调用一个函数,并在其中调用表单submit;处理提交后,使用response.sendRedirectpage2.jsp;对不起,Alex,我想我的问题不清楚,请检查更新的,让我知道这适合哪里。谢谢。我想这正是你需要的: