if u re looking sfor some simple validation , then consider your java file as simple javascript function .
step 1 : make a base class with all the validation function like
public boolean isEmail(String fieldValue)
{
Pattern p = Pattern.compile(".+@.+\\.[a-z]+");
Matcher m = p.matcher(fieldValue);
if(!m.matches()) {
return false;
} else {
return true;
}
}
step 2 : initialize a variable valid = true ;
step 3 : initialize an object for this validator class in your desired form page
step 4 : call a validation function on click of form submit button
step 5 : use the object to call the validation function on your desired page and according to the result it gives , set valid = false or leave ,
step 6 : finally
if(valid)
{ ... submit the form ...}