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]

Reply via email to