Here's an idea. It is probably an enhancement that could work for 1.3.1+ or 1.4
and I'd like to hear other people's thoughts:
I would like to open up form validation to different kind of validating
strategies. For instance, right now there are two strategies: one validates
off form names, another off the action. What if there wanted to be a third? I
initially thought of this proposal as an incremental enhancement:
http://issues.apache.org/bugzilla/show_bug.cgi?id=38375
But I think there is always a bigger approach which I am shooting for.
Today, I wanted to create a subclass of ValidatorActionForm which would
contain some data points I wanted to share. But then I noticed some of my
forms are also ValidatorForm. There's a heirarchy here just for choosing keys.
I recommend this:
We allow an ActionForm to contain pluggable validation strategies. These
could then validate off the key, the URI, or any other custom strategy that
can be plugged in. Perhaps the strategy validates using Spring validation
instead. This could really open up some possibilities.
In conclusion, there would be no strict need to have a special subclasses of
ActionForm only for validation. We could then promote the use of ActionForm
with pluggable strategies. But for convienence, the ValidatorForm and
ValidatorActionForm would continue sticking around with the appropriate
strategy already set.
What do you think?
Paul
---------------------------------
Do you Yahoo!?
With a free 1 GB, there's more in store with Yahoo! Mail.