There's more...

You could increase the validators by adding a Bean Validation on it and, for example, defining the email property from User with an @Email constraint.

Get Java EE 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.