Strut validator doesn't work - Websphere

This is a discussion on Strut validator doesn't work - Websphere ; I am using struts 1.2.7 and validator framework 1.1.3, but it doesn't work. The form-bean defined in strut-config.xml <form-bean name="countryForm" dynamic="true" type="org.apache.struts.validator.DynaValidatorFor m"> <form-property name="id" type="java.lang.String"/> <form-property name="code" type="java.lang.String"/> <form-property name="engname" type="java.lang.String"/> <form-property name="chiname" type="java.lang.String"/> </form-bean> <action path="/country/updatecountrydetail" type="action.UpdateCountryAction" scope="request" ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Strut validator doesn't work

  1. Strut validator doesn't work

    I am using struts 1.2.7 and validator framework 1.1.3, but it doesn't work.
    The form-bean defined in strut-config.xml
    <form-bean
    name="countryForm"
    dynamic="true"
    type="org.apache.struts.validator.DynaValidatorFor m">
    <form-property name="id" type="java.lang.String"/>
    <form-property name="code" type="java.lang.String"/>
    <form-property name="engname" type="java.lang.String"/>
    <form-property name="chiname" type="java.lang.String"/>
    </form-bean>

    <action
    path="/country/updatecountrydetail"
    type="action.UpdateCountryAction"
    scope="request"
    name="countryForm"
    validate="false">
    <forward name="Success" path="/action/country/getcountryinformation" redirect="true"/>
    <forward name="Failure" path="/action/country/getcountrydetail"/>
    <forward name="Login" path="/login.jsp" redirect="true"/>
    </action>

    The formset defined in validator.xml
    <formset>
    <form name="countryForm">
    <field property="code"
    depends="required, minlength,maxlength">
    <arg key="prompt.countrycode"/>
    <arg key="${var:minlength}" name="minlength"
    resource="false"/>
    <arg key="${var:maxlength}" name="maxlength"
    resource="false"/>
    <var>
    <var-name>maxlength</var-name>
    <var-value>10</var-value>
    </var>
    <var>
    <var-name>minlength</var-name>
    <var-value>3</var-value>
    </var>
    </field>
    <field property="engname"
    depends="required">
    <arg key="prompt.engname"/>
    </field>
    </form>
    </formset>

    I have also added the plug-in tag in strut-config.xml for validator.

    Do I miss something so that it doesn't work ?


  2. Re: Strut validator doesn't work

    I don't think this is the correct group for this but and I am sure but now you have figured this out... but
    You need to have validate=true on your action.

+ Reply to Thread