Skip to content

Instantly share code, notes, and snippets.

@nosrednawall
Created June 4, 2018 12:47
Show Gist options
  • Save nosrednawall/dd8cd56232f6acd744d4bcbd3f07e8cb to your computer and use it in GitHub Desktop.
Save nosrednawall/dd8cd56232f6acd744d4bcbd3f07e8cb to your computer and use it in GitHub Desktop.
Validador de email regex jsf
<p:outputLabel value="Email:" for="email" />
<p:inputText id="email" value="#{seuBeanAqui}"
required="true" validatorMessage="Email inválido">
<f:attribute name="type" value="email" />
<f:passThroughAttribute name="placeholder" value="E-mail" />
<f:validateRegex
pattern="[\w\.-]*[a-zA-Z0-9_]@[\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]" />
<f:ajax event="blur" render="messageEmail" />
</p:inputText>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment