Revision: 9439
Author: [email protected]
Date: Wed Dec 15 17:27:19 2010
Log: Edited wiki page BeanValidation through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=9439

Modified:
 /wiki/BeanValidation.wiki

=======================================
--- /wiki/BeanValidation.wiki   Wed Dec 15 16:41:34 2010
+++ /wiki/BeanValidation.wiki   Wed Dec 15 17:27:19 2010
@@ -7,17 +7,37 @@
 = Introduction =

 GWT supports a subset of JSR 303 Bean Validation.
+At compile time GWT validation uses the same Validation Provider you use on the server to create Validator for all your objects
+
+= Quick Start =
+
+Annotate you beans with contstrants
+(see [http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/validation/src/com/google/gwt/sample/validation/shared/Person.java Person.java])
+
+{{{
+public class Person implements IsSerializable {
+  @Size(min = 4)
+  private String name;
+}}}
+
+Use the standard validation bootstrap to get a Validator on the client and validate your object +(see [http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/validation/src/com/google/gwt/sample/validation/client/ValidationView.javaValidationView.java])
+{{{
+Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
+Set<ConstraintViolation<Person>> violations = validator.validate(person);
+}}}
+

 == What is not supported ==
   * XML configuration
   * Validating non GWT compatible classes like Calendar

-== Known Issues ==
-
-=== Critical Bugs ===
+= Known Issues =
+
+== Critical Bugs ==
   * Calling the correct !ConstraintValidotor based on bean type (class).

-=== Other Issues ===
+== Other Issues ==
   * Many errors that would happen at runtime instead fail to compile.
   * Composite Constraints don't work.
   * !ReportAsSingleViolation has no effect.

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to