By default, Play includes the Java forms module ( play-java-forms ) when enabling .. ValidationError; @Validate public static class LoginForm implements .. As you can see we inject the Database object into the constraint's constructor and .