facebook

Validation Problems

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #267127 Reply

    Ian McDermid
    Participant

    I 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”&gt;
    <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”&gt;
    <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-GA

    Java jdk1.5.0_09

    #267128 Reply

    Ian McDermid
    Participant

    It 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

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Validation Problems

You must be logged in to post in the forum log in