0
我有一個表單,用戶可以重置他的密碼,如果他忘記了它。 resetForm.xhtml無法重置我的密碼CRUD
<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>
,這裏是我的管理豆
@ManagedBean(name = "accountMB")
@SessionScoped
public class AccountManagedBean implements Serializable {
private static Logger logger = Logger.getLogger(AccountManagedBean.class.getName());
@Inject
private AccountBusinessLocal accountBusinessLocal;
private String login;
private String password;
private Account passwordAccount;
public AccountManagedBean() {
customer = new Customer();
}
@PostConstruct
public void init() {
passwordAccount= new Account();
}
public String updateAccount() {
logger.log(Level.SEVERE, "*****Update account***** ");
passwordAccount = accountBusinessLocal.findByLogin(login);
accountBusinessLocal.UpdateAccount(passwordAccount);
logger.log(Level.SEVERE, passwordAccount.toString());
return "login.jsp";
}
}
我的問題是,當我輸入登錄名和新密碼並提交。數據庫中的密碼未更新,因此我無法使用新密碼登錄。
我在想什麼?