Struts Validator does not work

I spent a whole day trying to figure out a Struts validator problem. It's a web application containing three modules, but only one module does not perform Struts validation. The XML config files are perfectly fine, but no clue was given by the logger or compiler. The log file spits validateInteger error, but no helpful hints whatsoever were given even after turning on the root level logging to DEBUG level.

The only difference between the performing modules, and not performing module is that ActionForm validation vs. DynaValidatorForm. This shouldn't cause the validator to malfunction, IMO. After much googling, the answer turned out to be mismatching struts.jar and validation-rules.xml files. The main cause of the problem was upgrading the Struts framework from 1.2.4 to 1.2.7 in order to utilize the latest LazyDynaValidatorForm, which has been available since Struts 1.2.6. While upgrading struts.jar, I haven't updated the *.tld, *.dtd, and *.xml files.

Lesson learned: when upgrading Struts, make sure you upgrade both *.jar files and necessary configuration files.

Share this post

Comments (0)

    No comment

Leave a comment

All comments are moderated. Spammy and bot submitted comments are deleted. Please submit the comments that are helpful to others, and we'll approve your comments. A comment that includes outbound link will only be approved if the content is relevant to the topic, and has some value to our readers.


Login To Post Comment