Код BeanClass:
public void validEmail(FacesContext context, UIComponent component,
Object value) throws Exception
{
//Set the email pattern string
Pattern p = Pattern.compile(".+@.+\\.[a-z]+");
//Match the given string with the pattern
Matcher m = p.matcher(email);
//check whether match is found
boolean matchFound = m.matches();
if (matchFound)
System.out.println("Valid Email Id.");
else
System.out.println("Invalid Email Id.");
}
.xhtml Код:
<h:inputText title="Enter Email Address" value="#{registerBean.email}" id="eMail" required="true" validator="#{registerBean.validEmail}">
<rich:ajaxValidator event="oninputblur"/>
</h:inputText>
<rich:message for="eMail"/>
Исключение составляет:
/Register.xhtml @68,138 validator="#{registerBean.validEmail}": java.lang.NullPointerException
Как мне это исправить!