Creating the messagefactory.java file – HP Integrity NonStop H-Series User Manual
Page 448
exist = true;
s1 = getRord();
if (s1.equals("Delete")) {
/** Deleting employee Details* */
dao.deleteEmployee(getEmpid());
state = true;
} else if (s1.equals("Retrieve")) {
/** Retrieving employee Details* */
com.hp.empinfo.domain.Employee employee = dao
.getDetail(getEmpid());
setEmpid(employee.getEmpid());
setAge(employee.getAge());
setEmail(employee.getEmail());
setFirstname(employee.getFirstname());
setLastname(employee.getLastname());
resetUpdate();
} else {
s1 = "Incorrect";
state1 = true;
}
} else {
ntexist = true;
}
return s1;
}
public boolean isState() {
return state;
}
public void setState(boolean state) {
this.state = state;
}
public boolean isState1() {
return state1;
}
public void setState1(boolean state1) {
this.state1 = state1;
}
public boolean isNtexist() {
return ntexist;
}
public void setNtexist(boolean ntexist) {
this.ntexist = ntexist;
}
public String resetInsert() {
setAge(0);
setEmail(null);
setEmpid(0);
setFirstname(null);
setLastname(null);
setRord(null);
exist = false;
return "insert";
}
public String resetUpdate() {
setEmpid(0);
setRord(null);
state = false;
state1 = false;
return "update";
}
}
Creating the
MessageFactory.java
File
The
MessageFactory.java
class loads the message bundle of the specific locale and is used
in the Bean class to set the appropriate message for different fields when required.
448
Integrating MyFaces into Spring