it sounds like this is the direction the project is heading. One consideration, though, is that beans
tend to have other beans nested within themselves, whereas forms just have fields. Has anyone had
any success getting nested validations to work? A simple scenario may illustrate my point:
Classes A, B, and C are all beans. Classes A and B both contain C, and both have getC() methods.
I want to set up validation rules for class C, and I want those validations run whenever I validate A and B,
too.
One solution is to use the dot-notation in the property name:
<form name="A"> <field property="c.x" depends="required"/> <field property="c.y" depends="required"/> <...other "A" validations...> </form>
<form name="B"> <field property="c.x" depends="required"/> <field property="c.y" depends="required"/> <...other "B" validations...> </form>
But this doesn't nicely lend itself to code reuse, because I have to repeat my "C" validations
everywhere. I'm thinking that something like this may be better:
<form name="A"> <field property="c" nested="C"/> <...other "A" validations...> </form>
<form name="B"> <field property="c" nested="C"/> <...other "B" validations...> </form>
<form name="C"> <field property="x" depends="required"/> <field property="y" depends="required"/> </form>
This is obviously a longer-term solution, requiring changes to the commons-validator core. Has anyone
instead tried doing something similar using a validator method?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
