Last active
October 20, 2016 09:45
-
-
Save mkuehle/f9a87ee9f417f69f037472feb0dfbebf to your computer and use it in GitHub Desktop.
Java EE 7 - JAX-RS Bean Validation - Query Parameter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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