Hi

i used validator and i got problems with validWhen, i wrote validWhen
with caps and until i change to validwhen it didn't work properly.

Please send us the struts-config.xml or the <action> you use, maybe the
problem is there.


El mar, 05 de 09 de 2006 a las 13:05, Mallik escribió:

> HI Friends
> i am using validation framework with struts at fontend
> but the validation is not working properly
> first-time validation is taking place at server side ( displaying errors on
> window)
> second-time onwards it is taking place at client side (getting alert)
> why these all?
> this is my code:
> ------------------------------------------------------
> struts-config.xml
> 
> <form-bean name="LoginForm"
> type="org.apache.struts.validator.DynaValidatorForm">
>       <form-property name="userId" type="java.lang.String"/>
>       <form-property name="password" type="java.lang.String"/>
> </form-bean>
> .......
> .....
> <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
> <set-property property="pathnames"
> value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> </plug-in>
> 
> ------------------------------------------------------
> validator.xml
> 
> <form  name="LoginForm">
> <field property="userId" depends="required,minlength,maxlength">
> <arg0 key="label.userId" />
> <arg1 key="${var:minlength}" name="minlength" resource="false" />
> <var>
> <var-name>minlength</var-name>
> <var-value>4</var-value>
> </var>
> <arg2 key="${var:maxlength}" name="maxlength" resource="false"/>
> <var>
> <var-name>maxlength</var-name>
> <var-value>10</var-value>
> </var>
> </field>
> <field property="password" depends="required,minlength,maxlength">
> <arg0 key="label.password"/>
> <arg1 key="${var:minlength}" name="minlength" resource="false" />
> <var>
> <var-name>minlength</var-name>
> <var-value>4</var-value>
> </var>
> <arg2 key="${var:maxlength}" name="maxlength" resource="false"/>
> <var>
> <var-name>maxlength</var-name>
> <var-value>10</var-value>
> </var>
> </field>
> </form>
> ------------------------------------------------------------
> resources.properties file
> 
> #validator errors
> errors.required = {0} is required.
> errors.minlength = {0} cann't be less than {1} characters.
> errors.maxlength = {0} cann't be more than {2} characters.
> errors.invalid = {0} is invalid.
> 
> # -- Label messages --
> label.userId = User ID
> label.password = Password
> ----------------------------------------------------------------
> login.jsp file
> 
> <html:javascript formName="LoginForm" dynamicJavascript="true"
> staticJavascript="false" />
> 
> and i didn't change anything in validation-rules.xml
> 
> 
> please let me know where i went worng
> 
> Mallik

-- 
;-)
____________________________________
Jorge Martin Cuervo
Analista Programador

Outsourcing Emarketplace
deFacto Powered by Standards

email <[EMAIL PROTECTED]>
voz +34 985 129 820
voz +34 660 026 384
____________________________________

Reply via email to