I am not sure where to post this bug i found in JavaRanch site so i am posting it here(also i wanted to know how to resolve such an issue) .
Bug Info : Go to "I lost my Password Link" and provide your email id and it take you to a page where it says check your mail. Now on Refresh of the screen you will see that a new mail comes to your inbox so for each refresh one new mail, i believe its a double submit problem ie the HTTp request being resubmitted on each refresh but i am not sure how to solve this issue.
Ulf Dittmer wrote:Yes, a new request is being submitted, but -the form using a POST- the browser advises that this could have consequences, and asks the user whether that is indeed what she intended (at least Firefox and Safari do). Are you saying that your browser doesn't do that? If so, what OS and browser version are you using?
Yes, My browser complains that but what i am looking is just a refresh of that confirmation page with out the Post request being resend ..is it possible to do that any way ?
Ernest Friedman-Hill wrote:The request for the confirmation page is the POST request to send you the email. There's no way to ask the server to send you that page except by asking it to send you the email. There's no bug here; the only bug is your expectation of how things should work.
I have read this in the JavaRanch FAQ regd the PostRedirectGet pattern basically to avoid the double submit Issues..below is the snippeet :
The key to implementing the PRG pattern is to insure that a page is never displayed as a result of a request of type POST. Here, this is done by redirecting to a read-only version of the page "
Isn't it a better idea to implement it at the confirmation page ? I am aware that we are currently showing a pop-up warning but just to understand which is a better implementation considering that its the developers choice to choose among them..
Vijay Kumar koganti wrote:
Isn't it a better idea to implement it at the confirmation page ?
Are we talking about how to make the Saloon a better web site, or are we just talking about random programming topics here? I can't tell if you are trying to report an actual problem (I don't see one here) or just trying to talk shop.
The pattern you describe is indeed the right way to prevent double-submits when it matters; the pattern is used elsewhere on the Saloon, actually. Now, if you were ordering something from an e-commerce site, then yes, the programmer should do whatever possible to prevent an accidental double order.But in this case, all the page does is send an email to the person making the request. Sending a hundred emails wouldn't do any actual harm, so there's really no reason for the redirect and extra page request.