0

I am using Struts2 xml validaion (action-validation.xml). My problem is when I clicked the save button more than one time, the error message also appears repeatedly. how to resolve this issue?

Roman C
  • 49,761
  • 33
  • 66
  • 176
SKG
  • 164
  • 1
  • 2
  • 19

1 Answers1

2

You should prevent submitting the form (and saving the data) twice, instead of caring about the double error messages, that will go away automatically once you'll solve the real problem.

To prevent double form submission, disable your submit button with javascript; to prevent F5 from the landing page, use Post Redirect Get Pattern, or history.pushState(). To prevent multiple submissions even when crafted, use a token (TokenInterceptor in Struts2).

Read more:

Community
  • 1
  • 1
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243