Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package controllers;
 
 
 public class FormController {
     public Response form(Form 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(12, "phone");
    	form.min(11, "fax");
    	
    	if (!form.hasErrors()) {
    		return Response.withOk().andTextBody("Fancy that!");
    	}
    	
    	return Response.withOk(); 
    }
New to GrepCode? Check out our FAQ X