I have searched this problem on Internet and java ranch forum. I have not luck so far. Please give your feedback where I am making mistake. Thanks in advance.
I am using validator framework for some validations. However, I want to use separate validation for few validations. When I use separately, they work fine. However, when I use form validate() method, validator framework validations does not work.
In order for the Validation framework to work, your form bean must extend ValidatorForm. It is the validate method in VaidatorForm that performs the framework validations. If you override the validate() method, you override the framework validations with your validations, making it so the framework validations are no longer performed.
You can get around this by replacing your current code with something like the following:
This way you populate the ActionErrors object with whatever errors the validation framework finds, and then add whatever errors you find in your logic.
Thank you very much. It is working perfactly fine.
Howeover, I have got one problem. I was trying for very long but still no success.
I am filling up various selection optins from database using action (VolunteerRegiInitAction) and forwarding to jsp page (volunteerRegistration.jsp). From there, it submit for another action (). Everything is working fine. However, when I submit form with some wrong validated value, it shows errors - that is fine.
However, after showing errors, when I reset page using <html:reset /> it reset to previous submitted value. Please can you give idea if you know where I am wrong.
What do you expect the reset button to do? This button resets all the fields on the form to what they were when the page was displayed. In your case, this would be the values when the page was shown after the validation error.
Danger, 10,000 volts, very electic .... tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss