Oracle ADF Email Validation
public void emailTextValidation(FacesContext facesContext, UIComponent uIComponent, Object object) {
public void emailTextValidation(FacesContext facesContext, UIComponent uIComponent, Object object) {
if(object!=null){
String name=object.toString();
String expression="^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
CharSequence inputStr=name;
Matcher matcher=pattern.matcher(inputStr);
String msg="Email
is not in Proper Format";
if(!matcher.matches()) throw new ValidatorException(newFacesMessage(FacesMessage.SEVERITY_ERROR,msg,null));
}
}
No comments:
Post a Comment