• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Double Submit Problem/Bug in JavaRanch Site

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. Cool
 
reply
    Bookmark Topic Watch Topic
  • New Topic