Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Double Submit Problem/Bug in JavaRanch Site

 
Vijay Kumar koganti
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Vijay Kumar koganti
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vijay Kumar koganti
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. Cool
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic