struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Turner" <>
Subject My dilema: Much improved version of requiredif ready, 1.1 or 1.2?
Date Thu, 06 Mar 2003 05:56:07 GMT
As I'm sure we've all noticed, the "requiredif" validation, although
seeming to be very popular, is a bear for first time users to
comprehend.  With that in mind, I've just finished a new validation
(which I'm calling "requiredwhen" to avoid confusion), which is much
simpler.  Here's a sample rule:

<field property="firstName" indexedListProperty="dependents" 
  <arg0 key="dependentlistForm.firstName.label"/>
    <var-value>(dependents[].lastName != null)</var-value>

As you can see, you can now put any arbitrary booolean expression as the
test for required.  For example:

((dependents[].lastName == "James") and (options[1] == "true"))

If the parser sees "[]", it replaces it with the indexed property value
of the target field.

Here's the dilema.  I think it's a lot better than "requiredif", will
generate a lot less questions on struts-users, and let people do the
general types of checking they seem to want to do.  Also, since it's
just another rule being added to the Validation set, it shouldn't be
able to destabilize anything else in the release.  However, since it is
a new feature, I hesitate to add it to 1.1 because we're in freeze.

What do other people think?  Also, I used JavaCC to generate the parser,
there's should never be a need to regenerate the java files from the jtt
source, but should someone want to do it, they'd need to download
JavaCC.  Will this be a problem?


          New Gig!
 |   |   |   |   |   |   |   |
\|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/
 V   V   V   V   V   V   V   V
Director of Software Development
Benefit Systems, Inc.

Voice: 603-216-1620
Fax: 317-573-2016 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message