public class EditCompanyAction extends Action { @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //cast the form object CompanyForm companyForm = (CompanyForm) form; //copy the companyForm data to a Company object //insert data in the db using a separate object try{ companyManager.insert(company); return mapping.findForward("success"); catch(Exception e) { return mapping.findForward("failure"); } }