commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Avery <>
Subject [validator] Resource bundle with standalone validation
Date Wed, 20 Apr 2005 16:54:13 GMT
I want to use a resource bundle to generate meaningful error messages, 
using Validator in a standalone, non-Struts environment.

What do I need to put in the Java class which instantiates and calls the 
Validator, so it understands which resourcebundle file to look up 
references like

xml config file:
       methodParams="java.lang.Object, org.apache.commons.validator.Field"

   <form name="simpleform">
      <field property="startDate" depends="required">
         <arg position="0" key="Start date"/>

the resource file would look like:

errors.required={0} is required.
errors.maxlength={0} cannot be greater than {1} characters.{0} is an invalid email address.

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

View raw message