public EmergencyContactBean(Person loggedUser) { EmergencyContact emergencyContact = (loggedUser.getProfile() == null) ? null : loggedUser.getProfile().getEmergencyContact(); if (emergencyContact != null) { setContact(emergencyContact.getContact()); } }
public ActionForward updateEmergencyContact( ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { EmergencyContactBean emergencyContactBean = getRenderedObject(); Person person = getLoggedPerson(request); try { EmergencyContact.updateEmergencyContact( person.getProfile(), emergencyContactBean.getContact()); } catch (DomainException e) { addActionMessage(request, e.getKey()); request.setAttribute("personBean", new PersonBean(person)); request.setAttribute("emergencyContactBean", new EmergencyContactBean(person)); } request.setAttribute("personBean", new PersonBean(person)); request.setAttribute("emergencyContactBean", emergencyContactBean); return mapping.findForward("visualizePersonalInformation"); }
public EmergencyContactBean(EmergencyContact emergencyContact) { setContact(emergencyContact.getContact()); }