## Code for email validation
if(object!=null){
String expression="^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
if(matcher.matches()){
}
else{
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,msg,null));
}
}
}
Thanks for posting complete code snippet. Its working and usefull.
ReplyDeleteWelcome. :)
ReplyDelete