Jakarta ee 不能';t重置我的密码CRUD
我有一个表单,用户可以在忘记密码的情况下重置密码。 resetForm.xhtmlJakarta ee 不能';t重置我的密码CRUD,jakarta-ee,jsf-2,crud,updates,Jakarta Ee,Jsf 2,Crud,Updates,我有一个表单,用户可以在忘记密码的情况下重置密码。 resetForm.xhtml <h:form id="newCustomerForm" > <fieldset> <legend>Rest Password</legend> <table border="0" > <
<h:form id="newCustomerForm" >
<fieldset>
<legend>Rest Password</legend>
<table border="0" >
<tbody >
<tr type="text">
<td>
<p:outputLabel value="Account Login :" for="pseudo"/>
</td>
<p:spacer height="5px" />
<td>
<p:inputText id="pseudo" value="#{accountMB.login}" title="Pseudo" required="true" requiredMessage="The Pseudo field is required.">
</p:inputText>
<p:watermark for="pseudo" value="Login" />
<p:message for="pseudo" display="text"/>
</td>
</tr>
<tr type="password">
<td>
<p:outputLabel value="New password :" for="pwd1"/>
</td>
<p:spacer height="5px" />
<td>
<p:password id="pwd1" value="#{accountMB.password}" feedback="true" match="pwd2" label="Password 1" required="true" requiredMessage="The Password field is required."/>
<p:watermark for="pwd1" value="Password" />
<p:message for="pwd1"/>
</td>
</tr>
<p:spacer height="5px" />
<tr type="password">
<td>
<p:outputLabel value="Confirm password :" for="pwd2"/>
</td>
<p:spacer height="5px" />
<td>
<p:password id="pwd2" value="#{accountMB.password}" feedback="true" label="Password 2" required="true" requiredMessage="The confirm password field is required."/>
<p:watermark for="pwd2" value="Confirm Password" />
<p:message for="pwd2"/>
</td>
</tr>
</tbody>
</table>
<div type="submit" align="right" style="margin-top: 5px">
<p:commandButton style="width: 130px; height: 40px" value="Save" ajax="false" icon="ui-icon-circle-check" styleClass="ui-priority-primary" action="#{accountMB.updateAccount()}"/>
</div>
</fieldset>
</h:form>
我的问题是当我输入登录名和新密码并提交时。数据库中的密码未更新,因此我无法使用新密码登录
我遗漏了什么???您没有实际更新passwordAccount对象中的密码
passwordAccount = accountBusinessLocal.findByLogin(login);
// now update the passwordAccount with the entered password
passwordAccount.setPassword(password);
accountBusinessLocal.UpdateAccount(passwordAccount);
passwordAccount = accountBusinessLocal.findByLogin(login);
// now update the passwordAccount with the entered password
passwordAccount.setPassword(password);
accountBusinessLocal.UpdateAccount(passwordAccount);