Skip to content

Instantly share code, notes, and snippets.

@mkuehle
Last active October 20, 2016 09:45
Show Gist options
  • Save mkuehle/f9a87ee9f417f69f037472feb0dfbebf to your computer and use it in GitHub Desktop.
Save mkuehle/f9a87ee9f417f69f037472feb0dfbebf to your computer and use it in GitHub Desktop.
Java EE 7 - JAX-RS Bean Validation - Query Parameter
@Path("/users")
public class UserResource {
...
@GET
@Path("/username-unique")
public Response isEmailUnique(
@QueryParam("name")
@NotNull
@Size(min=3, max=10, message="Der Name muss zwischen {min} und {max} Zeichen lang sein")
String username) {
// Check E-Mail Address in DB..
return Response.ok().build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment