Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: spelling & minor rewording

...

In JSR-303 validation groups are used you to define a subset of the constraints validated at a given time. If no validation group is specified the default Defaul Default group is taken. By default Tapestry passes only this group to Validator. You can tell Tapestry to pass more groups by contributing group classes into the configuration of the BeanValidatorSource service.

...

You can event mix JSR-303 annotations and Tapestry's @Validate @Validate annotation.

Code Block
java
java
public class Login
{
   @NotNull
   @Validate("maxlength=10")
   @Pattern(regexp = "[a-zA-Z]*")
   @Property @Persist
   private String userName;

   @NotNull 
   @Validate("minlength=5,maxlength=30")
   @Property @Persist
   private String password;

   void onSuccess()
   {
      // Login the user here
   }
}

...

Unfortunately JSR-303 doesn’t cover the client-side validation, so that most web frameworks supporting this JSR have to provide proprietary must provided still proprietary client-side solutions. Tapestry provides client-side validation for following JSR-303 constraints:

...