I think I am doing something terribly silly as I don't know why following simple validation doesn't work. This is very simple validation but when I hit submit on logon page w/o username, no validation takes place. FYI: I have all required jars in path. using tomcat 4-1-24 with struts 1.2.4
part of struts-config.xml <form-bean name="logonForm" type="org.apache.struts.validator.DynaValidatorForm"> <form-property name="user" type="java.lang.String"/> <form-property name="password" type="java.lang.String"/> </form-bean>
part of validator-rules.xml !DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN" "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
got this sucker working. it was issue with strus class in validator-rules.xml
"org.apache.struts.validator.FieldChecks" class and its method "validateRequired" with parameters Object, ValidatorAction etc... In my case, 4th parameter was set to "ActionErrors" instead of "ActionMessages" which doesnt reflect changes in struts 1.2 below is correct definition.
i can't believe i missed that...i migrated a bunch of apps from 1.1 to 1.2.4 a while ago and had to changed all ActionErrors to ActionMessages (as a matter of fact, i posted the migration process here before). it didn't cross my mind that you are using old validator-rules.xml against a later version. good job.
-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
pie. tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library