Setting validate="true" for an action means that the form bean's vaildate() method will be called. This will invoke the Struts Validator if you're using ValidatorForm.

David


Also, when using the validator, I have to set validate="true" for each
applicable action in my struts config.xml right?

- Keith


-----Original Message----- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2003 10:27 AM To: 'Struts Users Mailing List' Subject: RE: Validator


Where can I find the step by step instructions that you are referring to? I've tried a few examples, maybe the one you are referring to would help me out more. Thanx.


~ Keith


http://www.buffalo.edu/~kkamholz




-----Original Message----- From: Sergey Smirnov [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2003 3:20 PM To: Struts Users Mailing List Subject: Re: Validator


For client-site validation you can omit steps 9, 10, 11, 12 However couple more steps are required:

9a) <html:javascript formName="<your_form_name>"/> in page header
10a) for form tag: onsubmit="return validate<your_form_name>(this)"

So, 10 < 12 :-)

Also, I did not say that client-site validation is good and you need to use
it instead of server-site one.
The Tip says: If you have a problem when you test common validators, make a
client-validation first and than, when you fix the problem, return back to
server-site validation.

Client-site validation lights some problems that server-site hides. For
example, if you have a typo in validation.xml file, the page shows
javascript text stripped.

Regards,
Sergey Smirnov
-----------------------------------------
Exadel Struts Studio - IDE for Struts
http://www.exadel.com/strutsStudio
-----------------------------------------


----- Original Message ----- From: "Kris Schneider" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Friday, June 20, 2003 11:22 AM Subject: Re: Validator


> I would have suggested just the oppostite ;-). How does client-side
validation
> take fewer steps?
My experience has been that the additional tags and JavaScript
> wrangling actually add more steps and complexity. Most importantly,
client-side
> validation is optional while server-side validation should be mandatory.
Now
> that you've got conflicting suggestions, you can feel justified to start
> wherever you like ;-).
>
> I'm almost in a state of shock over the statement, "I wish my boss would
just
> let me use the validate method of the ActionForms." Come again?
>
> Quoting Sergey Smirnov <[EMAIL PROTECTED]>:
>
> > Cool tip:
> > Try to make client-site validation first.
> > Client-site validation requires less steps to implement and, ofter,
light
> > the mispeling errors. If client-site validation works, you need just a
> > couple more steps to have a server-site validation working.
> >
> >
> > ----- Original Message -----
> > From: "Kamholz, Keith (corp-staff) USX" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > Sent: Friday, June 20, 2003 10:41 AM
> > Subject: RE: Validator
> >
> >
> > > Thanks for the input.
> > > I'm pretty sure I've got all that though. This validator stuff is
> > driving
> > > me insane! I wish my boss would just let me use the validate method
of
> > the
> > > ActionForms.
> > >
> > > - Keith
> > >
> > >
> > > -----Original Message-----
> > > From: Sergey Smirnov [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, June 20, 2003 12:52 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: Validator
> > >
> > >
> > > Common mistake is: You forgot something or misspelt something. Week
ago I
> > > sent condition set you need to satisfy to make common validator
working.
> > It
> > > is bellow.
> > >
> > > For example, we have a very simple jsp form and
> > > want to use standard server-side validator 'required' for one form
field.
> > > Actually, it might vary, but to do so you have:
> > >
> > > 1) Resource (.properties) file with keys/values for standard
validators
> > (at
> > > least - errors.required)
> > > 2) struts-config file should contain the reference to this resource
file
> > for
> > > message-resources node
> > > 3) struts-config plug-in node should contain
> > > className="org.apache.struts.validator.ValidatorPlugIn"
> > > 4) this plugin should have set-property with name pathnames that
> > corresponds
> > > to validator files (such as /WEB-INF/validator-rules.xml and
> > > /WEB-INF/validation.xml)
> > > 5) validation.xml should contain form with name corresponds to
form-bean
> > > name
> > > 6) the form should have a field with property that corresponds to
field
> > name
> > > we want to validate
> > > 7) this field should have a 'depends' attribute that corresponds to
> > > validator name mentioned in /WEB-INF/validator-rules.xml (in our
case -
> > with
> > > name 'required')
> > > 8) this field should have an arg0 node which attribute key corresponds
to
> > > existing key in resource file
> > > 9) form bean should inherit org.apache.struts.validator.ValidatorForm
> > class
> > > 10) form bean validate should call validate method of super class
> > > 11) 'input' attribute of action should reference to jsp page with
> > validated
> > > form
> > > 12) jsp page should contains <html:errors /> (or its substitute)
> > >
> > > Regards,
> > > Sergey Smirnov
> > > -----------------------------------------
> > > Exadel Struts Studio - IDE for Struts
> > > http://www.exadel.com/strutsStudio
> > > -----------------------------------------
> > >
> > >
> > > ----- Original Message -----
> > > From: "Kamholz, Keith (corp-staff) USX" <[EMAIL PROTECTED]>
> > > To: "Struts (E-mail)" <[EMAIL PROTECTED]>
> > > Sent: Friday, June 20, 2003 9:25 AM
> > > Subject: Validator
> > >
> > >
> > > > Hey,
> > > > I'm trying to put validation into my application using the validator
> > > plugin.
> > > > However it doesn't seem like it's doing anything at all. I know
it's a
> > > very
> > > > general question, but what are some things I should look for? Are
> > there
> > > any
> > > > common mistakes in setting up that I should check for?
> > > >
> > > > I'm not sure if it's a related issue or not, but I have to specify
the
> > > name
> > > > attribute for each field of my forms. You're not supposed to have
to
> > > > specify the name right? What do you think I did wrong?
> > > >
> > > > Thanks in advance.
> > > >
> > > >
> > > > - Keith
> > > >



--------------------------------------------------------------------- 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]


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



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



Reply via email to