Last active
June 4, 2018 13:27
-
-
Save nosrednawall/36ee61e8ad15e5dc9b53ad17086242ce to your computer and use it in GitHub Desktop.
password regex validator jsf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p:outputLabel value="Senha" for="senha" /> | |
<p:password id="senha" value="#{seuBean.entidade.senha}" | |
feedback="true" | |
required="true" | |
requiredMessage="Campo senha não pode estar em branco" | |
validatorMessage="Senha inválida" | |
> | |
<f:attribute name="type" value="password" /> | |
<f:passThroughAttribute name="placeholder" value="No mímino 6 e no máximo 20 caracteres" /> | |
<f:validateRegex pattern="^(?=.*?[A-Z])(?=(.*[a-z]){1,})(?=(.*[\d]){1,})(?=(.*[\W]){1,})(?!.*\s).{8,99}$" /> | |
<f:ajax event="blur" render="messageSenha" /> | |
<p:message for="senha" id="messageSenha" /> | |
</p:password> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment