myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Extensions/Validator/DevDoc" by GerhardPetracek
Date Wed, 08 Apr 2009 07:37:06 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by GerhardPetracek:
http://wiki.apache.org/myfaces/Extensions/Validator/DevDoc

------------------------------------------------------------------------------
  }}}
  
  === group validation (partial validation) ===
+ jsr 303 specifies group validation. it means that only the constraints which match a given
group are validated.[[BR]]
+ so you can call it "partial validation". details are available [http://relation.to/10416.lace
here].
+ 
  jsf 2.0 integrates bean validation via tags[[BR]]
  e.g.: <f:validateBean validationGroups="javax.validation.groups.Default,app.validation.groups.Order"/>[[BR]]
  first of all it's quite a lot to type the fully qualified class name within a page[[BR]]
@@ -446, +449 @@

  the default group (javax.validation.groups.Default) is used just for view-id form1.jsp[[BR]]
  (if there is also an annotation at the class (see example 1) both information get added
to the context.)
  
- example 3:
+ example 4:
+ {{{
+ public class HelloWorldController
+ {
+     @BeanValidationController(@GroupValidation(use = @Group(User.class)))
+     private Person person = new Person();
+ ...
+ }
+ }}}
+ 
+ ... that means:[[BR]]
+ the User group is used to validate every expression which uses the person property of the
hello world controller bean.[[BR]]
+ 
+ example 4:
  {{{
  public class HelloWorldController
  {
@@ -470, +486 @@

  the User group is used to validate form1.jsp[[BR]]
  the Admin group is used to validate form2.jsp
  
- ==== possible targets ====
+ ==== possible/logical targets ====
   * page bean class
   * page bean fields/properties
   * last base of the bound property
@@ -485, +501 @@

   * propertyBase (in most szenarios this target isn't suggested)
   * property (in most szenarios this target isn't suggested)
  
+ summarized:[[BR]]
+ it's possible to annotate the first bean of an expression, its properties as well as the
last base and the final property.[[BR]]
+ that means: extval scans these logical targets and all levels in between are skipped.
+ 
  ==== comments ====
  @GroupValidation instead of @Validate to be clearer and to be neutral for future extensions
of @BeanValidationController
  

Mime
View raw message