I'm trying to save a data in a simple form through Hibernate using struts as the controller the problem, but there's error occurring when I submit the form
Cannot invoke com.myapp.struts.form.EmployeeEditForm.setEmpdob - argument type mismatch
I assume this is because of the type conflict, because the form field (refer to date of birth field) usually pass a string with the request but in my Form bean the type refers as a Java Data object, so what my real question is where do I type cast this string in to a Data object.
Snippet from my form bean
private Date empdob;
public void setEmplname(String emplname) {
this.emplname = emplname;
}
public Date getEmpdob() {
return empdob;
}
My action class
public ActionForward saveEmployee(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EmployeeEditForm employeeEditForm = (EmployeeEditForm) form;
BusinessDao businessDao = new BusinessDao();
businessDao.saveEmployee(employeeEditForm.getEmp());
return mapping.findForward("showList");
}
BusinessDao is the DAO to the separation layer to the persistence layer.
Thanks.