@@ -0,0 +1,1481 @@
+package de.asw.courses.web2016.demo.backend.jaxrs;%0A%0Aimport javax.validation.Valid;%0Aimport javax.validation.constraints.Min;%0Aimport javax.validation.constraints.NotNull;%0Aimport javax.ws.rs.POST;%0Aimport javax.ws.rs.Path;%0Aimport javax.ws.rs.Produces;%0Aimport javax.ws.rs.core.MediaType;%0Aimport javax.xml.bind.annotation.XmlRootElement;%0A%0A@Path(%22/validationExample%22)%0Apublic class ValidationExampleResource %7B%0A%0A%09/**%0A%09 * %0A%09 * %3Cp%3E%0A%09 * Example Payload bad%0A%09 * %3C/p%3E%0A%09 * %0A%09 * %3Cpre%3E%0A%09 *      %7B%0A%09 *      %22username%22:%22tester%22,%0A%09 *      %22password%22: %22test1234%22,%0A%09 *      %22age%22: 17%0A%09 *      %7D%0A%09 * %3C/pre%3E%0A%09 * %3Cp%3E%0A%09 * Example Payload good%0A%09 * %3C/p%3E%0A%09 * %0A%09 * %3Cpre%3E%0A%09 *      %7B%0A%09 *      %22username%22:%22tester%22,%0A%09 *      %22password%22: %22test1234%22,%0A%09 *      %22age%22: 18%0A%09 *      %7D%0A%09 * %3C/pre%3E%0A%09 * %0A%09 * @see http://localhost:8080/asw2016-demo-webapp/resources/validationExample/user%0A%09 * @return%0A%09 */%0A%09@POST%0A%09@Path(%22/user%22)%0A%09@Produces(MediaType.APPLICATION_JSON)%0A%09public User validate(@Valid User user) %7B%0A%09%09return user;%0A%09%7D%0A%0A%09@XmlRootElement%0A%09public static class User %7B%0A%0A%09%09@NotNull%0A%09%09String username;%0A%0A%09%09String password;%0A%0A%09%09@Min(18)%0A%09%09int age;%0A%0A%09%09public String getUsername() %7B%0A%09%09%09return username;%0A%09%09%7D%0A%0A%09%09public void setUsername(String username) %7B%0A%09%09%09this.username = username;%0A%09%09%7D%0A%0A%09%09public String getPassword() %7B%0A%09%09%09return password;%0A%09%09%7D%0A%0A%09%09public void setPassword(String password) %7B%0A%09%09%09this.password = password;%0A%09%09%7D%0A%0A%09%09public int getAge() %7B%0A%09%09%09return age;%0A%09%09%7D%0A%0A%09%09public void setAge(int age) %7B%0A%09%09%09this.age = age;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add example for BeanValidation usage in JAX-RS