Bean ValidationPage added by Igor DrobiazkoIntegrate JSR 303 - Bean Validation APITapestry provides a powerful validation mechanism which is described here. Among other things this mechanism allows you to annotate your domain model classes with the annotation @Validate. This annotation is problematic if your domain model is used in non-Tapestry applications as well as in Tapestry applications. Your non-Tapestry application becomes dependent on tapestry5-annotations. To make your domain model independent from Tapestry you can use the JSR 303: Bean Validation. This library provides integration between Tapestry and JSR-303. ConfigurationThe Tapestry's JSR 303 - Bean Validation Library is responsible for configuring and bootstrapping the Validator for you. In order to use this library you have to choose an implementation of the JSR-303 specification like Hibernate Validator 4.x. This library is not specific to any implementation of JSR-303 and will work with any implementation of your choice. Bootstraping the Bean ValidatorThe service BeanValidatorSource is responsible for bootstrapping the Validator. You can contribute a BeanValidatorConfigurer to the configuration of this service in order to participate on the configuration of Validator. @Contribute(BeanValidatorSource.class) public static void provideBeanValidatorConfigurer(OrderedConfiguration<BeanValidatorConfigurer> configuration) { configuration.add("MyConfigurer", new BeanValidatorConfigurer() { public void configure(javax.validation.Configuration<?> configuration) { configuration.ignoreXmlConfiguration(); } }); }
Change Notification Preferences
View Online
|
- [CONF] Apache Tapestry > Bean Validation confluence
- [CONF] Apache Tapestry > Bean Validation confluence
- [CONF] Apache Tapestry > Bean Validation confluence
- [CONF] Apache Tapestry > Bean Validation confluence
- [CONF] Apache Tapestry > Bean Validation confluence
- [CONF] Apache Tapestry > Bean Validation confluence