aspose file tools*
The moose likes Ranch Office and the fly likes Double Submit Problem/Bug in JavaRanch Site Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Ranch Office
Bookmark "Double Submit Problem/Bug in JavaRanch Site" Watch "Double Submit Problem/Bug in JavaRanch Site" New topic
Author

Double Submit Problem/Bug in JavaRanch Site

Vijay Kumar koganti
Ranch Hand

Joined: Jan 23, 2006
Posts: 53
Hi all,

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.

regards,
vijay


vijay kumar k.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42946
    
  70
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?
Prasanna Puttappa
Ranch Hand

Joined: Jul 21, 2003
Posts: 54
Hi Vijay,
I think your interested in solving duplicate submission problem as well. You can implement Synchronizer token pattern to solve duplicate submission. Sample implementation using Struts is available at Struts thread


~Prasanna (SCJP5.0, SCWCD5)
Vijay Kumar koganti
Ranch Hand

Joined: Jan 23, 2006
Posts: 53
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
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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.


[Jess in Action][AskingGoodQuestions]
Vijay Kumar koganti
Ranch Hand

Joined: Jan 23, 2006
Posts: 53
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.


Hi Friedman,
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..

regards,
vijay
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Ernest Friedman-Hill wrote: Sending a hundred emails wouldn't do any actual harm, so there's really no reason for the redirect and extra page request.


I understood your point Ernest . But why this extra work to the mail server ? what is the problem to avoid this ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42946
    
  70
The problem is that it takes time and effort to change this, but has no tangible benefit. If you send us a patch to JForum that addresses this I promise we'll look into adding that to our codebase.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

Seetharaman Venkatasamy wrote:But why this extra work to the mail server ?

It's not a significant amount of work. And it doesn't happen enough to be worth fixing.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Ok. Cool
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Double Submit Problem/Bug in JavaRanch Site