This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am currently add the validation rules to: 1. the method validate() of the ActionForm 2. the pattern matching rules inside validate.xml
However, I found something interesting.
Before I add the checking, when I put my data inside the JSP, the form captures the data, and they display correctly in the textfields (Many add/drop actions are done and redirect back to the original page).
In these cases, I will not do anything for checking.
However, when the user clicks submit, I will let the form be checked by validate(), as well as the validate.xml.
If there is no errors, that's fine, the data can be saved inside the DB.
But if there is errors, the form data is reset to the original value!!! All updates are lost!