commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stewart Cambridge <>
Subject [validator] Extending org.apache.commons.validator.Field
Date Thu, 13 Oct 2005 17:26:16 GMT
Dear All,

I'm using the commons validator with Struts and want validations to
not stop at the first failure, but to run against all fields and so
return a set of failures, not just the first one (basically, in a form
of 30 fields, if a user gets several wrong, I can see him getting
annoyed because on each form submission, the next validation failure
is reported, rather than reporting them all at once).

I found an email from Bill Siggelkow <> on Thu,
12 Aug 2004 16:23:17 GMT
where he hacks the Field class.

Wanting a less hacky solution I tried to extend this class, and put it
in a package that is not org.apache, but and have found
several methods and class attributes are either package or private
I wondered if this was deliberate. Would there be any harm in making
private methods protected so they can be extended?

Or is a better solution for me to submit a full fix to the org.apache
class including letting the validate(Map, Map) method take its cue
from the new
<set-property property="stopOnFirstError" value="false"/>
attribute when the validator is plugged in (which is there for the
javcascript as I understand it)
(Even so, I would still want to use protected methods, because maybe
someone else wants to extend the class...)

Or maybe this functionality is already present and I've somehow missed
it in my searching.

Many thanks,


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

View raw message