I need a regular expression to validate password as below:
The password must be in the default: ipe @ 1234 (letters, special characters and numbers)
I'm using this below, but it does not validate the error:
<p:password id="passwordInput" class="password" size="35"
maxlength="20" value="#{funcionarioBean.novaSenha}"
required="true" validatorMessage="Senha válida somente no padrão ipe@1234.">
<f:validateRegex pattern="((?=.\d)(?=.[a-z])(?=.[A-Z])(?=.[@#$%]).{6,20})"/>
</p:password>
The message "Valid password only in ipe @ 1234" is always displayed, even using the ipe @ 1234 password.
This is the xhtml that I am using to validate:
<ui:define name="conteudo">
<p:growl id="frmLoginGeral" />
<div id="redefinir">
<h:form>
<input type="hidden" id="idFunc" name="idFunc"
value="#{param['id']}" />
<div class="senha">
<div class="row2">
<p:outputLabel class="nova_senha" value="Crie uma nova senha" />
<br /> <br />
</div>
<div class="row_center">
<div class="row3">
<p:outputLabel class="label_senha" value="Crie sua nova senha: " />
<br />
<p:password id="passwordInput" class="password" size="35"
maxlength="20" value="#{funcionarioBean.novaSenha}"
required="true"
validatorMessage="Senha válida somente no padrão ipe@1234.">
<f:validateRegex
pattern="((?=.*\d)(?=.*[a-zA-Z])(?=.*[@#$%])[a-zA-Z0-9@$$%]{8,20})"/>
</p:password>
* <br /> <br />
<p:outputLabel class="label_senha"
value="Confirme sua nova senha: " />
<br />
<p:password id="passwordInput2" class="password" size="35"
maxlength="20" value="#{funcionarioBean.novaSenhaConfirma}" />
* <br /> <br />
</div>
<h:commandButton class="botao" value="Confirmar"
actionListener="#{funcionarioBean.gerarSenha}"
update=":frmLoginGeral" />
</div>
</div>
</h:form>
</div>
</ui:define>
And this is the error message:
WARNING: org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
javax.el.ELException: org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
at org.apache.el.parser.AstValue.invoke(AstValue.java:260)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:149)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:813)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:201)
at org.hibernate.internal.AbstractSessionImpl.getJdbcConnectionAccess(AbstractSessionImpl.java:341)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.<init>(JdbcCoordinatorImpl.java:114)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.<init>(TransactionCoordinatorImpl.java:89)
at org.hibernate.internal.SessionImpl.<init>(SessionImpl.java:258)
at org.hibernate.internal.SessionFactoryImpl$SessionBuilderImpl.openSession(SessionFactoryImpl.java:1589)
at org.hibernate.internal.SessionFactoryImpl.openSession(SessionFactoryImpl.java:999)