I don't know where to find a complete documentation of validator. Try to
set the form name attribute to be equal to the action path attribute
(which is required by the server-side validation).

Like:

--- struts-config.xml ---
<action path="/Login"
        name="loginForm"
        input="/index.jsp" ... />

--- validator.xml ---
<form-validation>
   <form name="/Login">
      <field ... />
   </form>
</form-validation>

In the jsp, you could use the <html:javascript> tag with the
optional attribute method to specify the javascript method name
used to validate the form. The normal behavior is to concatenate
"validate" + form name, which will end to a method named
"validate/Login".

--- in the jsp ---
<html:javascript formName="/Login" method="validateLoginForm"/>

In can post a war file with a simple login form example if you are
interested.

Hope this help,

Fernando


----- Original Message ----- 
From: "Chen, Dean (Zhun)" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, May 31, 2002 4:18 PM
Subject: RE: please help - validator null pointer


> I'm getting the same error. I'm using DynaValidatorForm though
> 
>     <form-bean      name="filterForm" dynamic="true"
>  
> type="org.apache.struts.validator.DynaValidatorActionForm">
> 
> My validation.xml is:
> 
> <form-validation>
>     <form name="filterForm">
>         <field property="prop1" 
>         depends="required">
>             <arg0 key="label.prop1"/>
>         </field>
>         <field property="prop2" 
>         depends="required,long">
>             <arg0 key="label.prop2"/>
>         </field>
>     </form>
> </form-validation>
> 
> btw, where I can find the documentation on validation.xml?
> 
> Dean Chen


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to