- This topic has 1 reply, 1 voice, and was last updated 17 years, 10 months ago by Ian McDermid.
-
AuthorPosts
-
Ian McDermidParticipantI have created a new project using Struts 1.2. When I try to validate a simple login page, I get the following error:
ERROR [Validator] reflection: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest)
java.lang.NoSuchMethodException: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest)
at java.lang.Class.getMethod(Class.java:1581)My validation.xml is:
<!DOCTYPE form-validation PUBLIC “-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN”
“http://jakarta.apache.org/commons/dtds/validator_1_0.dtd”>
<form-validation><formset>
<form name=”loginForm”>
<field property=”userid” depends=”required”>
<arg0 key=”User ID” resource=”false” />
</field>
<field property=”password” depends=”required”>
<arg0 key=”Password” resource=”false” />
</field>
</form>
</formset>
</form-validation>Login Form is a DynaValidatorForm
<!DOCTYPE form-validation PUBLIC “-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN”
“http://jakarta.apache.org/commons/dtds/validator_1_0.dtd”>
<form-validation><formset>
<form name=”loginForm”>
<field property=”userid” depends=”required”>
<arg0 key=”User ID” resource=”false” />
</field>
<field property=”password” depends=”required”>
<arg0 key=”Password” resource=”false” />
</field>
</form>
</formset>
</form-validation>The function works OK, and the user is thrown back to the Login Screen when no values are entered, but the exception is always thrown.
Can you please point me in the right direction.
I am using:
Version: 5.1.0 GA
Build id: 20061111-5.1.0-GAJava jdk1.5.0_09
Ian McDermidParticipantIt appears that in Struts 1.2 the Javascript for Validation is in the commons-validator.jar. If I replace validation-rules.xml with one from Struts 1.1 everything works OK. Is this a known bug ???
I am downloading updates at the moment
Ian
-
AuthorPosts