这个和在MessageBean 方法里绑定一个方法是一样的效果
public void inputValueNotNullalidate(FacesContext facesContext, UIComponent uiComponent,
Object object) throws ValidatorException{
String inputValue = String.valueOf(object);
System.out.println("验证走了");
System.out.println(inputValue);
if(null == inputValue || "" ==inputValue){
throw new ValidatorException(new FacesMessage("必填项不能为空"));
}
}
这个是自己写验证,但是这个验证效果是一样的,只有带鼠标离开焦点的时候才回出发这个验证!!!