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 Thu, 09 Apr 2009 17:51:29 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

------------------------------------------------------------------------------
  there will be a context-param to deactivate this default behavior. in such cases example
1 and 2 make sense again.
  
  that means:[[BR]]
- normally you don't need to use @BeanValidation explicitly. jsr 303 constraints have the
default group (javax.validation.groups.Default) per default :). so the default group (javax.validation.groups.Default)
is validated implicitly (it's possible to deactivate this implicit validation). just if you
would like to add (or restrict) groups for all or for a specific view-id you have to use @BeanValidation.
+ normally you don't need to use @BeanValidation explicitly. jsr 303 constraints have the
default group (javax.validation.groups.Default) per default :). so the default group (javax.validation.groups.Default)
is validated implicitly. if you validate with a given group, the default group is deactivated.
just if you would like to add or restrict groups for all or for a specific view-id you have
to use @BeanValidation.
  
  ==== usage ====
  the following examples are available [http://svn.apache.org/repos/asf/myfaces/extensions/validator/branches/beanval_integration/trunk/examples/hello_world/
here][[BR]]
@@ -442, +442 @@

  {{{
  public class HelloWorldController
  {
-     @BeanValidation(viewId = "/form1.jsp")
+     @BeanValidation(viewIds = "/form1.jsp")
      private Person person = new Person();
  ...
  }
@@ -456, +456 @@

  {{{
  public class HelloWorldController
  {
-     @BeanValidation(use = @Group(User.class))
+     @BeanValidation(useGroups = User.class)
      private Person person = new Person();
  ...
  }
@@ -472, +472 @@

      private Person person = new Person();
  
      @BeanValidation.List({
-             @BeanValidation(viewId = "/helloWorld.jsp"),
+             @BeanValidation(viewIds = "/helloWorld.jsp"),
-             @BeanValidation(viewId = "/form1.jsp", use = @Group(User.class)),
+             @BeanValidation(viewIds = "/form1.jsp", useGroups = User.class),
-             @BeanValidation(viewId = "/form2.jsp", use = {@Group(Admin.class)})
+             @BeanValidation(viewIds = "/form2.jsp", useGroups = Admin.class)
      })
      public Person getPerson()
      {
@@ -513, +513 @@

  
  === topics to think about ===
  1) [[BR]]
- @BeanValidation(viewId = "/form1.jsp", use = @Group(...), restrict = @Group(...))[[BR]]
+ @BeanValidation(viewIds = "/form1.jsp", useGroups = [list groups], restrictGroups = [list
groups])[[BR]]
  example: to remove a group for a special property which was added at the class-level
  
  2) [[BR]]

Mime
View raw message