Hi folks,

I'd like to use the Stripes validation annotations in POJOs that are
used as ActionBean properties :

// not an action bean
class MyPojo {
  @Validate(required=true)
  private String myProp; // + usual get/set
}

class MyActionBean implements ActionBean {
  private MyPojo myPojo; // + get/set, but without @ValidateNestedProperties
}

Of course, I don't want to change anything in the action itself (using
ValidateNestedProperties).

The idea is simple : I'd like Stripes to recurse on the nested
properties, and check for Validation Annotations there, not only on
the bean itself...

I'm currrently looking at how DefaultActionBeanPropertyBinder and
DefaultValidationMetadataProvider, but it seems (after a quick look)
that it's not possible to hook some "instance-specific" code that
would do the job of recursing on "myProp", and add the nested object's
class Validation Annotations to the top level's bean class... I'm
currently trying to hack DefaultPropertyBinder, but it seems to
require quite a lot of stuff to be overriden (and almost entirely
rewritten)...

Any idea ?

Cheers

Remi

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to