I have the current situation: I have a struts form, which captures some data from HTML forms. I added some restrictions on it, like xxx field must contain only 6 characters, etc, and I define the validation rules from validate.xml.
For example, the value of the field is originally XXXXYYYY, when I click submit, since it violates the rules defined in validate.xml, an error message is shown, but then, the value of the field disappeared!!!
Any tricks I can use to preserve the field, even though it contains an invalid value? I have already set the forms as session.
I understand that the error handling of Struts engine, it will NOT call the action method defined ActionDispatch nor the validate method inside the form, thus, I have no *programming* ways to save the updated value from the request.
Java Developer, Thailand
posted 16 years ago
But where can I access to the request/session, if the form data cannot be validated by validator.xml?
If I turn this feature on, if the checking cannot be passed, all the rest *rountines* will be bypass, and the control will be redirect to the JSP with error message (Thus, validate() in Form, and action in ActionDispatcher will NOT be called).