F5 When you refresh the page, the Web browser needs to resend the information you previously submitted, if you want to display the page again ... To click Retry ", how do I not let the solution appear for this dialog box

Source: Internet
Author: User

How do I cancel the retry dialog box that pops up when I refresh a page?
looking for a lot of similar questions do not have the answer I want, please see clearly and then answer.
For example, in the process of login, after success to another page success.jsp,
at this point, if you refresh the page, the Retry dialog box appears, so how can you not let it appear?
Some people say with GET request, sorry, user login is impossible with GET request, data unsafe ...

------To solve the idea----------------------
the same question, help the top
------To solve the idea----------------------
with Ajax, there's no such thing.
------To solve the idea----------------------
as long as there is a POST request to a page, refreshing the page will cause a "retry" phenomenon

Workaround:
The request page sends a request to an intermediate page (or servlet), the intermediate page processes the request, and the result is stored in session
then use Response.sendredirect (...) to jump to success.jsp
when the success.jsp is refreshed, there is no "retry".

but this method consumes server-side memory, preferably emptying the session in time
------To solve the idea----------------------
discuss
The 7 floor method is feasible, but it is unlikely to do so.
------------------------------

------To solve the idea----------------------
"Retry" is specified in the HTML standard, if you want to remove, there are the following methods:
1. It is recommended that the HTML Standards Committee remove the "retry" and wait for them to change the standard
2. Develop a browser, do not adhere to the HTML standard, do not "retry"
3. Tell the user that this page cannot be refreshed.

I usually use the method 3.
------To solve the idea----------------------
There are forms submitted pages as little as possible with the refresh it ... Otherwise, there will be unexpected results sometimes.
------To solve the idea----------------------
you need to completely replace the current page.
------To solve the idea----------------------
change the form submission to a link
------To solve the idea----------------------
change the form submission to window.location.href= .....? ...??????????????? Username=***.value&password=***.value
before submitting the project test to Ali, they gave us this as a serious bug, which was rather depressing.
------To solve the idea----------------------
JSP is submitted to the servlet before jumping to the JSP.
------To solve the idea----------------------
Submit page with Ajax also not very good, recommended mask refresh.
------To solve the idea----------------------
prevent duplicate submissions, almost all web frameworks solve this problem, the principle is 7 floor said, first process the request and then 302 jump
if success.jsp want to show something and don't want to get dirty, just put it in the URL.
------To solve the idea----------------------

this should be the case, such as landing page is login.do,post back to login.do, if it is struts, you can use Actionmessages Returns the check parameter, if the login is successful, use Location.href to turn. This avoids the problem of refreshing .




Should you order a server button, the refresh will be resubmitted once.
The simplest way to do this is to use Response.Redirect (Request.Url.ToString ()) in your commit event; Jump to the current page


So the solution is coming, since the submission form will not be rejected, then we will make a form refresh, first we have to find out when the page is refreshed when there is something to be repeatedly submitted, This involves a server object request, for the moment, as a web developer is very familiar with it, whether it is the post mode or get or even a mixed submission of data submitted by the way, are stored in this object, then the data items to be taken out into a hidden domain in the form, Action is set to _self and the commit is executed, then the effect will be the same as pressing F5 and then clicking on the unlucky "retry" effect.


Because the server control is clicked, and then refreshed, you will be prompted to retry or cancel, the operation is done in JavaScript, complex operation can be done with Ajax to complete the
response.write ("  <script>window.location.href= ' Test.aspx ';  </script> "


because you're using a server control that has viewstate=true enabled, you try changing to Fales to see if the value is still in the


<%@ page set enableviewstate=" true ";

<%@ page enableviewstate=" true "&NBSP;%>

F5 When you refresh the Web page, the Web browser needs to resend the information you previously submitted if you want to display the page again ... To click Retry, how do I not allow this dialog box to appear in the solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.