You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dennis Muhlestein <de...@zserve.com> on 2003/04/21 18:49:16 UTC

Validator Best Practice

I have a dynavalidatorform configured in struts-config.  One of the 
properties (emails) is a java.lang.String[]  Each array element 
represents an email address.

To validate the contents of this array, in my validator I put the 
indexedListProperty="emails".  For property however, I had to put a 
property of String.  The only property of String is bytes.  Rather than 
create a simple value bean just to hold the contents of the string, 
validator can just call the getBytes method.

It works ok.  I just thought I'd post and see if anyone had a better idea.

 >>>> Pertinent validation.xml <<<<<<<<<<

  <field property="bytes"
            indexedListProperty="emails"
            depends="email">
            <arg0 resource="false"
                key="Email Address"/>
   </field>


What do you all think?

-Dennis


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org