user2149100
user2149100

Reputation: 1

How to use both validate() and validation.xml in Struts 1?

I am using the validation framework with Struts 1.x, and have some validation rules declared in validation.xml.

I needed some more complex validation, so I also override the validate() method in the form.

It turns out that, overriding the validate() method cancels out the usage of validation.xml. Is this true?

Can validate() and validation.xml coexist on the same action form?

Upvotes: 0

Views: 1470

Answers (1)

Roman C
Roman C

Reputation: 1

It will cancel the struts validation if you override the validate method and not call the super.validate(mapping, request). Do it in your code to coexist the custom validation through validate method and framework validation via validation.xml.

Upvotes: 1

Related Questions