Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Webpage has expired" in Spring Framework MVC

I have a project based in Spring Web model-view-controller (MVC) framework. The version of the Spring Web model-view-controller (MVC) framework is 3.2.8 deployed on a WebLogic Server Version: 12.1.2.0.0

I have this form in 1 JSP

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

I make a couple of actions using the method POST.. after this I use the browser (IE11) back button and I got this error

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.

I also tried to redirect in the POST method

  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"; 
like image 214
Amadeu Cabanilles Avatar asked Feb 03 '17 10:02

Amadeu Cabanilles


People also ask

What is Spring MVC life cycle?

The Spring Web MVC framework provides Model-View-Controller (MVC) architecture and ready components that can be used to develop flexible and loosely coupled web applications.

Is Spring MVC still relevant?

Spring MVC Benefits Spring MVC shines when it comes to: Promoting separation of concerns - it's great way to develop modular web applications. Abstracts away the tedious and boilerplate tasks of handling HTTP requests. Excellent support for developing RESTful web services.

Where should I put HTML file in spring boot?

html file should be placed under the templates directory and all JS and CSS files should be placed under the static directory in classpath. In the example shown, we used CSS file to change the color of the text. Now, we need to add the Spring Boot Starter Thymeleaf dependency in our build configuration file.

What is spring mvc4?

Spring MVC is a Model-View-Controller(MVC) web framework build on notion of a central Front Controller servlet (DispatherServlet) which is responsible for dispatching each request to appropriate handlers, resolving views and finally returning the response.


1 Answers

Just set the method form method to get, and when you click on the submit button, just change it to post

like image 149
en Lopes Avatar answered Sep 30 '22 17:09

en Lopes