我根据 JSF 2 规范注册了一个验证器:
@FacesValidator(value = "emailValidator")
public class EmailValidator implements Validator {..}
用法 :
<h:inputText value=#{bean.email}>
<f:validator id="emailValidator" />
</h:inputText>
我得到这个例外:
javax.servlet.ServletException: /contact.xhtml @21,130 <f:validator> A validator id was not specified. Typically the validator id is set in the constructor ValidateHandler(ValidatorConfig)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
myapp.FilterLogout.doFilter(FilterLogout.java:83)
那是一个错误吗?