@Name("validatorError") @Scope(ScopeType.EVENT) @BypassInterceptors public class ValidatorError { /** * isInvalid. * @return boolean */ public boolean isInvalid() { Iterator<FacesMessage> iterator = FacesContext.getCurrentInstance() .getMessages(); while (iterator.hasNext()) { FacesMessage facesMessage = iterator.next(); if (FacesMessage.SEVERITY_ERROR.equals(facesMessage.getSeverity())) { return true; } } return false; } }