Greg,

Thanks for your response.
Is this validator framework supported for struts 1.1 since I use struts
1.1 for my application.

Thanks,
Divya.

-----Original Message-----
From: Greg Ludington [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 15, 2004 10:11 AM
To: Struts Users Mailing List
Subject: Re: Validation in struts


> It is said that the validation(client side validations like say a 
> particular textbox field can contain numbers only etc) should not be 
> explicitly written in client-side validation javascripts in a struts 
> framework. How can such things be accomplished using struts without 
> writing specific client-side validation javascripts functions on the 
> jsp page? Any help is greatly appreciated.

You will want to read up on the Validator framework.  When you use the
Validator, you configure rules about your form in an XML file.  Struts
will use those rules to perform server-side validation, but, for many
basic types of validation, Struts can also (optionally) emit the proper
javascript for client-side validation.  You can still write your own
javascript, if you need to or want to, but for many validation tasks --
including the "can contains numbers only" scenario you mentioned --
Struts will do it for you.

You can find a HOWTO guide on the Validator on the Struts site here:
http://struts.apache.org/userGuide/dev_validator.html

Also, I believe the Struts distribution ships with a validator example.

-Greg

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