Skip to content

Instantly share code, notes, and snippets.

@mkuehle
Created October 20, 2016 09:47
Show Gist options
  • Save mkuehle/d728a723090a97234ff3fc9b32764ef8 to your computer and use it in GitHub Desktop.
Save mkuehle/d728a723090a97234ff3fc9b32764ef8 to your computer and use it in GitHub Desktop.
Java EE 7 - JAX-RS Bean Validation - DTO
public class User {
@NotNull(message="Der Name muss angegeben werden")
@Size(min=3, max=10, message="Der Name muss zwischen {min} und {max} Zeichen lang sein")
private String name;
@NotNull(message="Die E-Mail Adresse ist ein Pflichtfeld")
private String email;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment