RE: [REPOST] [Validator] REQUIREDIF Question

2003-02-14 Thread Jerry Jalenak
James,

You, sir, are wy wiser in the use of regular expressions than I hope to
ever be. The whole escape this, don't escape that thing continues to
confound me.  Anyway, I've updated my validator.xml with the changes to the
mask, and it appears to be working (i.e. it returns to the original input
form).  However, I am not getting any messages displayed via my
 tag.  I've checked and the default validator messages are in
my ApplicationResources.properties, and have verified that it is being
loaded (at least according to the Tomcat console log).  Has something
changed in how messages are rendered recently?  I'm using the nightly build
from Feb. 10, 2003   Any ideas?

TIA!

Jerry

> -Original Message-
> From: James Turner [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 14, 2003 11:48 AM
> To: 'Struts Users Mailing List'
> Cc: [EMAIL PROTECTED]
> Subject: RE: [REPOST] [Validator] REQUIREDIF Question
> 
> 
> The problem, sir, lies not in your requiredif, but in your mask.
> 
> When you say:
> 
> ^[A-Za-z -']+$
> 
> What you're literally saying is "A to Z, a to z, and space to 
> '".  What
> you want to say is:
> 
> ^[A-Za-z\ \-\']+$
> 
> When I used the correct mask, everything worked correctly. (i.e., if
> patientId was blank, the other three fields were required and had to
> obey the mask.  If patientId was not black, the other three could be.)
> 
> James
> 
> > -Original Message-
> > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, February 14, 2003 10:02 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: [REPOST] [Validator] REQUIREDIF Question
> > 
> > 
> > Sri - thanks for the reply.  We have several other 
> > validations going on with this form-bean, so I'm confident 
> > that your first two items are OK.  I've also pulled the 
> > 'REQUIREDIF' check out of the validation in question (leaving 
> > just the MASK) and everything behaves correctly.  I've also 
> > been over the validator docs countless times, and have 
> > verified that the general approach matches what is in the 
> > doc.  The only thing I can come up with is that the MASK 
> > processing is screwing things up some way
> > 
> > I'm about to a point of writing a custom validation routine 
> > just to get by this, but would sure like to use the REQUIREDIF
> > 
> > Jerry
> > 
> > > -Original Message-
> > > From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 14, 2003 8:35 AM
> > > To: Struts Users Mailing List
> > > Subject: RE: [REPOST] [Validator] REQUIREDIF Question
> > > 
> > > 
> > > Nothing out of the ordinary jumps out from what you have
> > > sent.  That being said, following are a few points; a list 
> > > which you have probably already checked and double-checked:
> > > 
> > > * Have you set the validator plug-in element in the 
> > >   struts-config?
> > > * Is the name of the form-bean in the action mapping also
> > >   "UserInfo"?
> > > * Have you ensured that the requiredIf logic is being invoked
> > >   at all?  You could test this by say, changing the logic 
> > >   (just for test purposes).  For example, change the NULL 
> > >   criterion to some dummy string literal.  Then actually enter 
> > >   that literal on the JSP and see if the requiredif logic 
> > >   is triggered
> > > 
> > > Sri
> > > 
> > > -Original Message-
> > > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 14, 2003 8:38 AM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: [REPOST] [Validator] REQUIREDIF Question
> > > 
> > > 
> > > I'm reposting this in the hope that someone can tell what I'm
> > > doing wrong. I can't seem to figure out why this doesn't 
> > > work.  Any (and all) help is greatly appreciated
> > > 
> > > I have a rather simple form with 4 fields on it.  If the 
> first field
> > > (patientId) is left blank, then the other three fields
> > > (lastName, firstName,
> > > dob) are required.  So, in struts-config I have
> > > 
> > > 
> > >> > type="org.apache.struts.validator.DynaValidatorForm">
> > >> > type="java.lang.String"/>
> > >> > type="java.lang.String"/&g

RE: [REPOST] [Validator] REQUIREDIF Question

2003-02-14 Thread James Turner
The problem, sir, lies not in your requiredif, but in your mask.

When you say:

^[A-Za-z -']+$

What you're literally saying is "A to Z, a to z, and space to '".  What
you want to say is:

^[A-Za-z\ \-\']+$

When I used the correct mask, everything worked correctly. (i.e., if
patientId was blank, the other three fields were required and had to
obey the mask.  If patientId was not black, the other three could be.)

James

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 14, 2003 10:02 AM
> To: 'Struts Users Mailing List'
> Subject: RE: [REPOST] [Validator] REQUIREDIF Question
> 
> 
> Sri - thanks for the reply.  We have several other 
> validations going on with this form-bean, so I'm confident 
> that your first two items are OK.  I've also pulled the 
> 'REQUIREDIF' check out of the validation in question (leaving 
> just the MASK) and everything behaves correctly.  I've also 
> been over the validator docs countless times, and have 
> verified that the general approach matches what is in the 
> doc.  The only thing I can come up with is that the MASK 
> processing is screwing things up some way
> 
> I'm about to a point of writing a custom validation routine 
> just to get by this, but would sure like to use the REQUIREDIF
> 
> Jerry
> 
> > -Original Message-
> > From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 14, 2003 8:35 AM
> > To: Struts Users Mailing List
> > Subject: RE: [REPOST] [Validator] REQUIREDIF Question
> > 
> > 
> > Nothing out of the ordinary jumps out from what you have
> > sent.  That being said, following are a few points; a list 
> > which you have probably already checked and double-checked:
> > 
> > * Have you set the validator plug-in element in the 
> >   struts-config?
> > * Is the name of the form-bean in the action mapping also
> >   "UserInfo"?
> > * Have you ensured that the requiredIf logic is being invoked
> >   at all?  You could test this by say, changing the logic 
> >   (just for test purposes).  For example, change the NULL 
> >   criterion to some dummy string literal.  Then actually enter 
> >   that literal on the JSP and see if the requiredif logic 
> >   is triggered
> > 
> > Sri
> > 
> > -Original Message-
> > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 14, 2003 8:38 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: [REPOST] [Validator] REQUIREDIF Question
> > 
> > 
> > I'm reposting this in the hope that someone can tell what I'm
> > doing wrong. I can't seem to figure out why this doesn't 
> > work.  Any (and all) help is greatly appreciated
> > 
> > I have a rather simple form with 4 fields on it.  If the first field
> > (patientId) is left blank, then the other three fields
> > (lastName, firstName,
> > dob) are required.  So, in struts-config I have
> > 
> > 
> >  > type="org.apache.struts.validator.DynaValidatorForm">
> >  > type="java.lang.String"/>
> >  > type="java.lang.String"/>
> >  > type="java.lang.String"/>
> >  > type="java.lang.String"/>
> > 
> > 
> > 
> > and in my validator-rules I am using
> > 
> > 
> > 
> > 
> > 
> >  > key="errors.field.invalid"
> > />
> >  > key="UserInfo.patientId.displayname"
> > />
> > 
> > mask
> > ^[0-9]+$
> > 
> > 
> > 
> >  > key="errors.field.required" />
> >  > key="errors.field.invalid"
> > />
> >  > key="UserInfo.lastName.displayname" />
> > 
> > mask
> > ^[A-Za-z
> > -']+$
> > 
> > 
> > field[0]
> >

RE: [REPOST] [Validator] REQUIREDIF Question

2003-02-14 Thread James Turner
I'll take a look at this later today.  There have been a number of
people saying that they have had problems with REQUIREDIF, so I want to
make sure it's still working.

James

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 14, 2003 8:38 AM
> To: '[EMAIL PROTECTED]'
> Subject: [REPOST] [Validator] REQUIREDIF Question
> 
> 
> I'm reposting this in the hope that someone can tell what I'm 
> doing wrong. I can't seem to figure out why this doesn't 
> work.  Any (and all) help is greatly appreciated
> 
> I have a rather simple form with 4 fields on it.  If the first field
> (patientId) is left blank, then the other three fields 
> (lastName, firstName,
> dob) are required.  So, in struts-config I have
> 
> 
>type="org.apache.struts.validator.DynaValidatorForm">
>type="java.lang.String"/>
>type="java.lang.String"/>
>type="java.lang.String"/>
>type="java.lang.String"/>
>   
> 
> 
> and in my validator-rules I am using
> 
> 
>   
>   
>   
>key="errors.field.invalid"
> />
>key="UserInfo.patientId.displayname"
> />
>   
>   mask
>   ^[0-9]+$
>   
>   
>   
>key="errors.field.required" />
>key="errors.field.invalid"
> />
>key="UserInfo.lastName.displayname" />
>   
>   mask
>   ^[A-Za-z
> -']+$
>   
>   
>   field[0]
>   patientId
>   
>   
>   
> field-test[0]
>   NULL
>   
>   
>   
>key="errors.field.required" />
>key="errors.field.invalid"
> />
>key="UserInfo.firstName.displayname"
> />
>   
>   mask
>   ^[A-Za-z
> -']+$
>   
>   
>   field[0]
>   patientId
>   
>   
>   
> field-test[0]
>   NULL
>   
>   
>depends="requiredif, mask">
>key="errors.field.required" />
>key="errors.field.invalid"
> />
>   
>   
>   mask
>   ^[0-9]+$
>   
>   
>   field[0]
>   patientId
>   
>   
>   
> field-test[0]
>   NULL
>   
>   
>   
>   
> 
> 
> The REQUIREDIF check does not seem to be working as the 
> validation is passed successfully.  I suspect it has 
> something to do with the form property being a String, but 
> being checked against a NULL in validator.  I checked the 
> validator docs and this appears to be the correct way of 
> doing this.  Am I just missing something obvious?
> 
> TIA!
> 
> Jerry Jalenak
> Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> [EMAIL PROTECTED]
> 
> 
> 
> This transmission (and any information attached to it) may be 
> confidential and is intended solely for the use of the 
> individual or entity to which it is addressed. If you are not 
> the intended recipient or the person responsible for 
> delivering the transmission to the intended recipient, be 
> advised that you have received this transmission in error and 
> that any use, dissemination, forwarding, printing, or copying 
> of this information is strictly prohibited. If you have 
> received this transmission in error, please immediately 
> notify LabOne at the following email address: 
> [EMAIL PROTECTED]
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail

RE: [REPOST] [Validator] REQUIREDIF Question

2003-02-14 Thread Sri Sankaran
> The only thing I can come up with is that the MASK 
> processing is screwing things up some way
> 

One way to confirm that would be to remove the "mask" test.

> Jerry

Sri

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




RE: [REPOST] [Validator] REQUIREDIF Question

2003-02-14 Thread Jerry Jalenak
Sri - thanks for the reply.  We have several other validations going on with
this form-bean, so I'm confident that your first two items are OK.  I've
also pulled the 'REQUIREDIF' check out of the validation in question
(leaving just the MASK) and everything behaves correctly.  I've also been
over the validator docs countless times, and have verified that the general
approach matches what is in the doc.  The only thing I can come up with is
that the MASK processing is screwing things up some way

I'm about to a point of writing a custom validation routine just to get by
this, but would sure like to use the REQUIREDIF

Jerry

> -Original Message-
> From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 14, 2003 8:35 AM
> To: Struts Users Mailing List
> Subject: RE: [REPOST] [Validator] REQUIREDIF Question
> 
> 
> Nothing out of the ordinary jumps out from what you have 
> sent.  That being said, following are a few points; a list 
> which you have probably already checked and double-checked:
> 
> * Have you set the validator plug-in element in the 
>   struts-config?
> * Is the name of the form-bean in the action mapping also
>   "UserInfo"?
> * Have you ensured that the requiredIf logic is being invoked
>   at all?  You could test this by say, changing the logic 
>   (just for test purposes).  For example, change the NULL 
>   criterion to some dummy string literal.  Then actually enter 
>   that literal on the JSP and see if the requiredif logic 
>   is triggered
> 
> Sri
> 
> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 14, 2003 8:38 AM
> To: '[EMAIL PROTECTED]'
> Subject: [REPOST] [Validator] REQUIREDIF Question
> 
> 
> I'm reposting this in the hope that someone can tell what I'm 
> doing wrong. I can't seem to figure out why this doesn't 
> work.  Any (and all) help is greatly appreciated
> 
> I have a rather simple form with 4 fields on it.  If the first field
> (patientId) is left blank, then the other three fields 
> (lastName, firstName,
> dob) are required.  So, in struts-config I have
> 
> 
>type="org.apache.struts.validator.DynaValidatorForm">
>type="java.lang.String"/>
>type="java.lang.String"/>
>type="java.lang.String"/>
>type="java.lang.String"/>
>   
> 
> 
> and in my validator-rules I am using
> 
> 
>   
>   
>   
>key="errors.field.invalid"
> />
>key="UserInfo.patientId.displayname"
> />
>   
>   mask
>   ^[0-9]+$
>   
>   
>   
>key="errors.field.required" />
>key="errors.field.invalid"
> />
>key="UserInfo.lastName.displayname" />
>   
>   mask
>   ^[A-Za-z
> -']+$
>   
>   
>   field[0]
>   patientId
>   
>   
>   
> field-test[0]
>   NULL
>   
>   
>   
>key="errors.field.required" />
>key="errors.field.invalid"
> />
>key="UserInfo.firstName.displayname"
> />
>   
>   mask
>   ^[A-Za-z
> -']+$
>   
>   
>   field[0]
>   patientId
>   
>   
>   
> field-test[0]
>   NULL
>   
>   
>depends="requiredif, mask">
>key=&

RE: [REPOST] [Validator] REQUIREDIF Question

2003-02-14 Thread Sri Sankaran
Nothing out of the ordinary jumps out from what you have sent.  That being said, 
following are a few points; a list which you have probably already checked and 
double-checked:

* Have you set the validator plug-in element in the 
  struts-config?
* Is the name of the form-bean in the action mapping also
  "UserInfo"?
* Have you ensured that the requiredIf logic is being invoked
  at all?  You could test this by say, changing the logic 
  (just for test purposes).  For example, change the NULL 
  criterion to some dummy string literal.  Then actually enter 
  that literal on the JSP and see if the requiredif logic 
  is triggered

Sri

-Original Message-
From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] 
Sent: Friday, February 14, 2003 8:38 AM
To: '[EMAIL PROTECTED]'
Subject: [REPOST] [Validator] REQUIREDIF Question


I'm reposting this in the hope that someone can tell what I'm doing wrong. I can't 
seem to figure out why this doesn't work.  Any (and all) help is greatly 
appreciated

I have a rather simple form with 4 fields on it.  If the first field
(patientId) is left blank, then the other three fields (lastName, firstName,
dob) are required.  So, in struts-config I have










and in my validator-rules I am using








mask
^[0-9]+$







mask
^[A-Za-z
-']+$


field[0]
patientId


field-test[0]
NULL







mask
^[A-Za-z
-']+$


field[0]
patientId


field-test[0]
NULL







mask
^[0-9]+$


field[0]
patientId


field-test[0]
NULL






The REQUIREDIF check does not seem to be working as the validation is passed 
successfully.  I suspect it has something to do with the form property being a String, 
but being checked against a NULL in validator.  I checked the validator docs and this 
appears to be the correct way of doing this.  Am I just missing something obvious?

TIA!

Jerry Jalenak
Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496
[EMAIL PROTECTED]



This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at the following email 
address: [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]