wood burning stoves 2.0*
The moose likes Struts and the fly likes Refresh problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Refresh problem" Watch "Refresh problem" New topic

Refresh problem

david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133

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

Joined: Sep 29, 2008
Posts: 12617

Post-redirect-get pattern.
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
Thank you David. I am looking at the pattern and learning.

I agree. Here's the link: http://aspose.com/file-tools
subject: Refresh problem
Similar Threads
How to redirect to same page in struts 2
JSP session tracking problem
get a greek string through an html form
Retaining values between JSP pages