What feature are you referring to?  the min/max
validators or defining a second mask validator as
'mask2'?  Also, this would depend on the validator
version you are using.  Are you asking if the latest
release will work with Struts 1.0?  It should. 
Someone said they were using a more current release of
the validator with the Struts 1.0 release.  It uses
the commons packages (bean, digester, and collections)
though so you would need to add them to your
WEB-INF/lib directory.

David

--- "Trieu, Danny" <[EMAIL PROTECTED]> wrote:
> is this feature available in Struts 1.0?
> 
> -----Original Message-----
> From: David Winterfeldt
> [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 21, 2001 1:04 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Questions About Struts Validator
> 
> 
> That isn't possible with the default mask validator.
> 
> I've recently added a min and max length validation
> to
> nightly builds though.  Or you could either write
> your
> own mask validation method that accepts multiple
> inputs or you can define the mask validator again
> under a different name like mask2.
> 
> <validator name="mask2"
>         
>
classname="com.wintecinc.struts.validation.StrutsValidator"
>          method="validateMask"
>          depends="required"
>          msg="errors.invalid">
> 
> 
>  <field    property="lastName"
>          depends="required,mask,mask2">
>            <msg name="mask"
> key="registrationForm.lastname.maskmsg"/>
>            <msg name="mask2"
> key="registrationForm.lastname.mask2msg"/>
>            <arg0
> key="registrationForm.lastname.displayname"/>
>            <arg1 name="maxlength" key="${var:maxlength}"
> resource="false"/>
>              <var>
>                <var-name>mask</var-name>
>                <var-value>^[a-z]*$</var-value>
>              </var>              
>              <var>
>                <var-name>mask2</var-name>
>                <var-value>^[A-Z]*$</var-value>
>              </var>              
>              <var>
>                <var-name>maxlength</var-name>
>                <var-value>16</var-value>
>              </var>
>  </field>
> 
> 
> David
> 
> --- Paul Darling <[EMAIL PROTECTED]>
> wrote:
> > Is is possible to use multiple 'mask' validators
> > that apply different
> > expressions?  
> > 
> > For instance, in addition to checking that a
> string
> > contains only a-z or A-Z
> > characters, you might want to validate the string
> > length.  It's possible to
> > use an expression that combines the types of
> > validation (e.g.
> > ^[a-zA-Z0-9]{,16}$), but then it's not possible to
> > use an error message that
> > is specific to whether the validation failed due
> to
> > the character content or
> > the length.
> > 
> > Paul 
> > 
> > -----Original Message-----
> > From: David Winterfeldt
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, October 11, 2001 1:17 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Questions About Struts Validator
> > 
> > 
> > This is what you were asking about though? 
> > Everything
> > makes sense now?
> > 
> > David
> > 
> > --- Vaughan Jackson
> <[EMAIL PROTECTED]>
> > wrote:
> > > David,
> > > 
> > > I am sorry, I hadn't understood this before.
> > > 
> > > Thanks again,
> > > Vaughan.
> > > 
> > > > -----Original Message-----
> > > > From: David Winterfeldt
> > > [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, October 11, 2001 12:17 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: RE: Questions About Struts Validator
> > > > 
> > > > 
> > > > For Q2:
> > > > You can override the default validator's error
> > > message
> > > > by specifying a msg element or you can change
> > the
> > > > defult of course.
> > > > 
> > > >  <field    property="lastName"
> > > >            depends="required,mask">
> > > >              <msg name="mask"
> > > > key="registrationForm.lastname.maskmsg"/>
> > > >              <arg0
> > > > key="registrationForm.lastname.displayname"/>
> > > >              <var>
> > > >                <var-name>mask</var-name>
> > > >               
> > <var-value>^[a-zA-Z]*$</var-value>
> > > >              </var>                
> > > >  </field>
> > > > 
> > > > You can also specify different arguments to go
> > > with
> > > > different errors.
> > > > 
> > > >  <field    property="integer"
> > > >            depends="required,integer,range">
> > > >              <arg0
> > key="typeForm.integer.displayname"/>
> > > >              <arg1 name="range" key="${var:min}"
> > > > resource="false"/>
> > > >              <arg2 name="range" key="${var:max}"
> > > > resource="false"/>
> > > >              <var>
> > > >                <var-name>min</var-name>
> > > >                <var-value>10</var-value>
> > > >              </var>                
> > > >              <var>
> > > >                <var-name>max</var-name>
> > > >                <var-value>20</var-value>
> > > >              </var>                
> > > >  </field>
> > > > 
> > > > David
> > > > 
> > > > 
> > > > --- Vaughan Jackson
> > > <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > David,
> > > > > 
> > > > > Thanks for your feedback. 
> > > > > 
> > > > > I will try out the technique you describe
> for
> > > Q1. 
> > > > > 
> > > > > I could have phrased Q2 better: "... and
> have
> > a
> > > > > different 
> > > > > error message resulting according to which
> > > rule(s)
> > > > > is/are
> > > > > broken?".
> > > > > 
> > > > > Yes, you have told me what I wanted to know
> > for
> > > Q3.
> > > > > 
> > > > > Vaughan.
> > > > > 
> > > > > > -----Original Message-----
> > > > > > From: David Winterfeldt
> > > > > [mailto:[EMAIL PROTECTED]]
> > > > > > Sent: Thursday, October 11, 2001 10:36 AM
> > > > > > To: [EMAIL PROTECTED]
> > > > > > Subject: Re: Questions About Struts
> > Validator
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > --- Vaughan Jackson
> > > > > <[EMAIL PROTECTED]>
> > > > > > wrote:
> > > > > > > Hi,
> > > > > > > 
> > > > > > > Three questions in fact. Some variants
> on
> > > these
> > > > > came
> > > > > > > up earlier,
> > > > > > > but we would like to know whether the
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Reply via email to