Spring Framework MVC中的“网页已过期”

我有一个基于Spring Web模型 - 视图 - 控制器(MVC)框架的项目。 Spring Web模型 - 视图 - 控制器(MVC)框架的版本是3.2.8,部署在WebLogic Server版本上:12.1.2.0.0

我在1个JSP中有这个表单

  <form:form commandName="deviceForm" 
                                                name="deviceForm"
                                                id="deviceFormId" 
                                                method="post"
                                                action="${contextPath}/device/${deviceForm.device.id}" 
                                                htmlEscape="yes"
                                                enctype="multipart/form-data">

我使用POST方法做了几个动作..在此之后,我使用浏览器(IE11)后退按钮,并且出现此错误

Webpage has expired




Most likely cause:
•The local copy of this webpage is out of date, and the website requires that you download it again.


Something to try:



  Click on the Refresh button on the toolbar to reload the page. After refreshing, you might need to navigate to the specific webpage again, or re-enter information.  



More information  More information   


If you continue to have this problem, try the following: 
1.In Internet Explorer, click the Tools button , click Internet Options, and then click the Advanced tab.
2.Scroll down and clear the “Do not save encrypted pages to disk” option in the Security settings.

我也尝试在POST方法中重定向

  response.setStatus(HttpServletResponse.SC_SEE_OTHER   );
        response.setHeader("Location", /device/" + device.id");
        response.setHeader("Connection", "close");
        response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
        response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
        response.setHeader("Expires", "0"); // Proxies.
return "redirect:/device/" + device.id"; 

只需设置要获取的方法表单方法,并且当您单击提交按钮时,只需将其更改为发布即可


如果您做出任何POST请求,浏览器将始终向您显示“网页已过期”。 如果再次刷新页面POST请求,请使用所有参数进行提交,因此仅当您有要提交的表单或您无法通过网址发送的内容时才使用POST请求。

1)将所有正常请求转换为GET请求,并仅保留提交请求作为POST请求。


将此标签添加到您的html页面:

<meta http-equiv="Cache-control" content="public">

更多信息:https://support.microsoft.com/en-us/help/183763/error-message-warning-page-has-expired-the-page-you-requested ...

链接地址: http://www.djcxy.com/p/38359.html

上一篇: "Webpage has expired" in Spring Framework MVC

下一篇: PHP (or whatever) CGI configuration in web.config IIS