Struts, Keep fields after validation fails

Discussions

General J2EE: Struts, Keep fields after validation fails

  1. Struts, Keep fields after validation fails (1 messages)

    Hi I'm using struts (action and actionForms)I have a Form with several inputs fileds, when a required field is empty and the user press submit, the validation in the actionForm fails and return the forward to failure (the same jsp),the problem is that after do the forward all the fields are in blank, even the fields that the user enter correctly. What I want to do is to keep the correct fields when a validation fails.

    Thanks
  2. I assume you use either declarative validation rules or ValidatorForm#validate() method. If so, how do you forward to failure? In case of problems, the validate() method just have to return a non-empty ActionErrors