Hi

Remove attribute="sForm" from the tag 'action'.
And try again.

>  <action
>       attribute="sForm"
>       input="/form/s.jsp"
>       name="sForm"
>       path="/s"
>       scope="request"
>       type="com.eam.struts.action.SAction"
>       validate="true">
>       <forward name="success" path="/welcome.do" />
>     </action>

regards
sateesh

-----Original Message-----
From: M.Liang Liu [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 30, 2006 10:18 AM
To: Struts Users Mailing List
Subject: Help:validation is not working with struts1.2

I tried to use validator in my struts application and I find a problem
occurred:
             The form did not validate itself and the execute method is
always called.

I active the plug-in in struts-config.xml as following:

> <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
>         <set-property
>         property="pathnames"
>         value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
>     </plug-in>
>
and I write the validation.xml as following:

> <?xml version="1.0" encoding="iso-8859-1"?>
> <!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>
>     <global>
>         <constant>
>             <constant-name>phone</constant-name>
>             <constant-value>^\(?(\d{3})\)?[-| ]?(\d{3})[-|
> ]?(\d{4})$</constant-value>
>         </constant>
>         <constant>
>             <constant-name>zip</constant-name>
>             <constant-value>^\d{5}\d*$</constant-value>
>         </constant>
>     </global>
>
>     <!-- ========================= Default Formset
> ========================= -->
>     <formset>
>         <form  name="sForm">
>             <field  property="name"  depends="required">
>                 <arg0  key="test.name"/>
>             </field>
>
>         </form>
>     </formset>
> </form-validation>
>
>
I write the struts-config.xml as following for mapping

>  <action
>       attribute="sForm"
>       input="/form/s.jsp"
>       name="sForm"
>       path="/s"
>       scope="request"
>       type="com.eam.struts.action.SAction"
>       validate="true">
>       <forward name="success" path="/welcome.do" />
>     </action>



The form extends the ValidatorForm,

But it does NOT work.

Who can  help me?


Thanks a lot.

-- 
Why Signature?
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Information transmitted by this EMAIL is proprietary to iGATE Group of 
Companies and is intended for use only by the individual 
or entity to whom it is addressed and may contain information that is 
privileged, confidential, or exempt from disclosure under 
applicable law. If you are not the intended recipient of this EMAIL immediately 
notify the sender at iGATE or [EMAIL PROTECTED] 
and delete this EMAIL including any attachments
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


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

Reply via email to