I guess that would work if you have validations corresponding to a
form i.eyou are extending DynaValidatorForm.

If you need to extend DynaValidatorActionForm, i.e give validations
corresponding to a action (as single form can be reused in different actions
and not all fields need to be validated in each case) then I feel you need a
call to validate.

Correct me if I'm wrong :-)

Regards,
Vishal

On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
>
> No mr.vishal i tried thats y im telling.
> u try without using validate method in local form.
> we have to mention the validation for each field in validation.xml file
> itself.
> no need of calling validate() in local form.
> definitely it will work.
>
>
>
> > You are right that there is no need to create a form bean if you are
> using
> > dyna form.
> >
> > However if you want to link your form with the validation framework then
> > you
> > do need to create a local form bean. This form bean would not have any
> > attributes and their getter and setter methods as they all are defined
> in
> > Struts config.
> >
> > All it would contain is a validate method with a call to super.validate
> ().
> > Please refer to the sample code in my last note for reference.
> >
> > Regards,
> > Vishal
> >
> > On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> > >
> > > no need to create a Form class in local. if we are using
> DynaActionForm,
> > > then
> > > no need of create form class in local.
> > > i tried in struts_config.xml only, it is working well.
> > >
> > >
> > >
> > >
> > >
> > >
> > > Quoting Vishal Gaurav <[EMAIL PROTECTED]>:
> > >
> > > > Hi,
> > > >
> > > > Simply having your dyna form bean of the type Dyna Validator form
> will
> > > not
> > > > work. You have to declare your form bean in the Struts Config as
> type
> > > any
> > > > local form bean you have. ( <form-bean name="ObjectTypeForm" type="
> > > > com.local.ABCForm">)
> > > >
> > > > Then your ABCForm will extend DynaValidatorForm or
> > > DynaValidatorActionForm
> > > > depending on yor requirement.
> > > >
> > > > It would have code similar to one given below
> > > >
> > > > public class LoginForm  extends DynaValidatorActionForm{
> > > > public ActionErrors validate(ActionMapping mapping,
> HttpServletRequest
> > > > request) {
> > > >
> > > >   ActionErrors errors = null;
> > > >   errors = super.validate(mapping, request);
> > > >
> > > >   return errors;
> > > >   }
> > > > }
> > > >
> > > > Hope this solves your problem.
> > > >
> > > >
> > > > On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > sorry u try this one. not previous one.
> > > > >
> > > > > <form-bean name="ObjectTypeForm"
> > > > > type="org.apache.struts.validator.DynaValidatorForm">
> > > > >    <form-property name="objectType" type=" java.lang.String" />
> > > > >    <form-property name="description" type="java.lang.String" />
> > > > > </form-bean>
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I am having some problems in  getting struts to
> > > > > > > validate my input form. It seems to completely ignore
> > > > > > > the validation and starts executing the action.
> > > > > > >
> > > > > > > Here are the relevant files. Any help regarding this
> > > > > > > is highly appreciated.
> > > > > > >
> > > > > > > TIA
> > > > > > >
> > > > > > > Maha
> > > > > > >
> > > > > > > struts-config.xml
> > > > > > > ------------------
> > > > > > >
> > > > > > >     <form-beans>
> > > > > > >       <!-- objectType form bean -->
> > > > > > >       <form-bean name="ObjectTypeForm"
> > > > > > >                        type="forms.ObjectTypeForm"
> > > > > > > dynamic="true">
> > > > > > >         <form-property name="objectType"
> > > > > > > type="java.lang.String"/>
> > > > > > >         <form-property name="description"
> > > > > > > type="java.lang.String"/>
> > > > > > >       </form-bean>
> > > > > > >
> > > > > > >     </form-beans>
> > > > > > >
> > > > > > > the action - mappings contains
> > > > > > >
> > > > > > >           <action  path="/ObjectType"
> > > > > > >                      type="actions.ObjectTypeAction"
> > > > > > >                   name="ObjectTypeForm"
> > > > > > >                   scope="request"
> > > > > > >                   validate="true"
> > > > > > >                   input="/objecttype.jsp"
> > > > > > >                   parameter="function">
> > > > > > >               <forward name="failure"
> > > > > > > path="/error.jsp" />
> > > > > > >               <forward name="success"
> > > > > > > path="/index.jsp" />
> > > > > > >               <forward name="goToAddStartPage"
> > > > > > > path="/objecttype.jsp" />
> > > > > > >           </action>
> > > > > > >
> > > > > > > The ObjectTypeAction class extends DispatchAction.
> > > > > > >
> > > > > > > validate.xml
> > > > > > > ------------
> > > > > > >
> > > > > > > <form-validation>
> > > > > > >     <formset>
> > > > > > >         <form name="ObjectTypeForm">
> > > > > > >             <field property="objectType"
> > > > > > > depends="required">
> > > > > > >                 <arg0 key="prompt.objecttype"/>
> > > > > > >             </field>
> > > > > > >         </form>
> > > > > > >     </formset>
> > > > > > > </form-validation>
> > > > > > >
> > > > > > > validation-rules.xml
> > > > > > > --------------------
> > > > > > >
> > > > > > > <form-validation>
> > > > > > >   <global>
> > > > > > >     <validator name="required"
> > > > > > >
> > > > > > > classname=" org.apache.struts.validator.FieldChecks"
> > > > > > >              method="validateRequired"
> > > > > > >        methodParams="java.lang.Object,
> > > > > > >
> > > > > > > org.apache.commons.validator.ValidatorAction ,
> > > > > > >
> > > > > > > org.apache.commons.validator.Field,
> > > > > > >
> > > > > > > org.apache.struts.action.ActionErrors,
> > > > > > >
> > > > > > > javax.servlet.http.HttpServletRequest"
> > > > > > >                 msg="errors.required">
> > > > > > >     </validator>
> > > > > > >   </global>
> > > > > > > </form-validation>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > __________________________________________________
> > > > > > > Do You Yahoo!?
> > > > > > > Tired of spam?  Yahoo! Mail has the best spam protection
> around
> > > > > > > http://mail.yahoo.com
> > > > > > >
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Thanks and Regards,
> > > > Vishal Gaurav
> > > > Ph : 9810482236
> > > > Email : [EMAIL PROTECTED]
> > > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to