Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refresh problem

 
david arnold
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

In struts project, there is a jsp page which includes a list of numbers with user names. There is a text filed for user to input name, then there is a button to generate a number. Once the user input the name and press the button, the jsp page will submit a form to action which contains the user name, the action will create a number for this name and returns the form (name and nubmer and other field) to the same jsp page. And the number and user name will show on the page. At the time if user click Refresh button of the browser unexpectly, a new number will created for the same user which is not wanted.

I tried to put no-catch in meta in head part, also I tried to empty the text filed right after the form get value in jsp page, but did not work. Could anyone help to explain what really happed behind the screen if Refresh is clicked and give some advice on how to avoid this?

Thanks for the help in advance.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post-redirect-get pattern.
 
david arnold
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you David. I am looking at the pattern and learning.

Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic