permaculture playing cards*
The moose likes Struts and the fly likes Duplicate form submission when I refresh page 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 "Duplicate form submission when I refresh page" Watch "Duplicate form submission when I refresh page" New topic

Duplicate form submission when I refresh page

Sujay Ramasamy

Joined: Jun 22, 2007
Posts: 4
I am new to struts, I am maintaining some form properties value in arrayList when, I refresh page form automatically posting last added form properties value add again to arraylist.
So Please any one can you guide me,
Thanks in advance
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Have the action that adds the records forward to another action or JSP with redirect=true specified in the forward. That way the URI displayed in the browser is not the same URI that causes a record to be added. Therefore, when the user clicks the refresh button, no record will be added. One thing to be aware of, though, is that when you specify redirect=true anything you put in the request is lost. You must pass information either in the session or query string parameters.

Consultant, Sima Solutions
It is sorta covered in the JavaRanch Style Guide.
subject: Duplicate form submission when I refresh page
Similar Threads
How to read the value selected in the selectOneMenu tag in the forwarded jsp page
form values lost in request scope
Problem in showing picture on jsp page
f:selectitems issue in jsf
IndexOutOfBounds in BeanUtils.Populate()