Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package controllers;
 
 
 public class FormController {
     private static final int MIN_SIZE = 11;
     private static final int MAX_SIZE = 12;
 
    public Response form() {
        return Response.withOk();
    }
    public Response validateform(Form form) {
        form.required("name");
        form.email("email");
        form.exactMatch("password""passwordconfirm"); //NOSONAR
        form.match("email2""email2confirm");
        form.ipv4("ipv4");
        form.ipv6("ipv6");
        form.max("phone");
        form.min("fax");
        if (!form.hasErrors()) {
            return Response.withOk().andTextBody("Fancy that!");
        }
        return Response.withOk();
    }
New to GrepCode? Check out our FAQ X