gpt4 book ai didi

mysql - "Confirm Form Resubmission"问题。 MVC servlets JSP javabean

转载 作者:行者123 更新时间:2023-11-29 00:59:23 25 4
gpt4 key购买 nike

大家好!为什么每次我在我的网站上单击某些内容并尝试返回一页时,它都会显示“确认提交表单”。我正在运行本地服务器。这与其他网站(如 Facebook)形成对比,在其他网站上,我可以返回页面,而不会出现要求我刷新页面的恼人消息。

最佳答案

确实很好的解释:

Because of the sloppy coding practices of web developers browsers were forced to add this message. the scenario is as follows:

1) user fills in form and submits (posts form)

2) the server process the post data and responds with a new page (confirm) marked as not cacheable

3) the user navigates to a new page.

4) the user press back:

for the the browser to display the page in step 2, because its marked no-cache, it must request it from the server, in other words do the repost of the data (do step 1). here is were the sloppy coding came in, if this was an credit card charge, and repost detection was not on the server, the card is charged twice. this was (is) so common a problem, that the browsers had to detect this and warn the users.

the best fix is in step two, the server sends a redirect to the confirm page. then when the user accesses the confirm via history or back, its a get request, not a post request and will not show the warning.

来源:http://forums.asp.net/p/1553589/3814773.aspx

关于mysql - "Confirm Form Resubmission"问题。 MVC servlets JSP javabean,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4380356/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com