• 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

Refresh problem

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

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

Regards.
 
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic