On 8/12/05, Romero, Ron <[EMAIL PROTECTED]> wrote: > > On August 12, 2005, Craig McClanahan [mailto:[EMAIL PROTECTED] wrote: > > > On 8/12/05, Romero, Ron <[EMAIL PROTECTED]> wrote: > > > > > I'm working with the Shale Validator. I would like a new, simpler > > > "regexValidator" tag that better supports my situation (and > hopefully > > > supports other people's situation). > > > > I'm definitely +1 on having support for regex validation ... but > > doesn't the "mask" validator already do that for you? If not, it > > would seem the right answer would be adding a new Commons Validator > > implementation so that all the frameworks using C-V would benefit. > > > > Actually, what I'm going for is more of a "repackaging" of the mask > validator, a convenience tag. The tag would resolve into a > commonsValidator, but it would look up the mask and arg first. You > get the same functionality as the mask validator, but you can > administer it from a single config file. It's a cleaner separation of > concern. The JSF developer concentrates on what is being input, a > name, a phone number, a social security number. And the regex > developer (who rights the regex config file) concentrates on what > those types look like (ten digit phone number codes, no punctuation > Characters in names, etc.) > > This wouldn't go into C-V because it's not another type of validation, > it's about making a cleaner interface for faces developers. > > > This would also mean you don't need a new tag ... the existing Shale > > tags for integrating validators would work. > > Ah, but I want a new tag! :-) Seriously, a new tag would make it > easier to use --- it's simpler to code and to understand. True, it > would hide the flexibility and power of the commonsValidator tag, but > we don't need or want that additional flexibility, and we'd like to > hide it from everyone else. >
And here's where the suggested approach isn't as appealing to me. Once you open the floodgates of creating a new tag for *this* sort of a validator, you likely end up where you need a tag for *every* sort of validator. To the maximum degree possible, I'd prefer to stick with just one tag <s:commonsValidator> that can call any of them. We only need to ensure that there is a way to set all the needed configurable properties such a validator would need. At the same time, having predefined patterns with easy to use names is exactly the sort of enhancement that *should* be made at the C-V level, so that everyone can benefit from it, rather than hiding it inside Shale :-). Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]