Details
Description
I added a password confirmation field into the User.java, corresponding field in create.jspx and update.jspx. I'd like to perform some password encryption before storing password in a database, so I added a @PrePersist @PreUpdate method in this class. When I add user (create.jspx), everything is ok. When I change user (update.jspx), form returns empty string instead of the entered not-empty confirmation field value. The same problem is with usual(non-password) text field.
User.java:
...
@Transient
private String newPasswd2 = "";
public String getNewPasswd2()
{ return newPasswd2; }public void setNewPasswd2(String newPasswd2)
{ this.newPasswd2 = newPasswd2; } @PrePersist
@PreUpdate
protected void encryptPassword() {
String pwd = this.getPwd(), pwd2 = this.getNewPasswd2(); // HERE pwd2 is EMPTY !
...
create.jspx:
<field:input field="newPasswd2" id="xxx_newPasswd2" required="true" type="password" z=""/>
update.jspx
<field:input field="newPasswd2" id="xxx_newPasswd2" required="true" type="password" z=""/>