java - Spring Framework MVC 中的 "Webpage has expired"

标签 java spring http spring-mvc internet-explorer

我有一个基于 Spring Web 模型- View - Controller (MVC) 框架的项目。 Spring Web模型- View - Controller (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"; 

最佳答案

只需将method表单方法设置为get,点击提交按钮时,改为post即可

关于java - Spring Framework MVC 中的 "Webpage has expired",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42021792/

相关文章:

java - Java 中的包装类和泛型说明

ruby - 如何使用 net/http ruby​​ 进行 curl 自定义 header 请求

http - 戈朗 : how to make http client not following redirects?

java - Ghost4J PDFConverter 生成 0KB PDF 文件

Java Spring Controller 断点和 JUnit

java - Spring Boot + Intellij Idea + Hibernate - 奇怪的堆栈跟踪

java - JPA 实体在 Ubuntu 上得到更新但在 Windows 上抛出乐观锁定异常

java - Jersey:将 Spring 组件注入(inject) ContainerRequestFilter

http - 解释 HTTP/1.1 header 字段值时使用什么编码

java - 违反 RFC 2109 : host > minus domain may not contain any dots