/** * Process the specified HTTP request, and create the corresponding HTTP response (or forward to * another web component that will create it). Return an <code>ActionForward</code> instance * describing where and how control should be forwarded, or <code>null</code> if the response has * already been completed. * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * @exception Exception if business logic throws an exception */ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes we will need MessageResources messages = getResources(request); // save errors ActionMessages errors = new ActionMessages(); // START check for login (security) if (!SecurityService.getInstance().checkForLogin(request.getSession(false))) { return (mapping.findForward("welcome")); } // END check for login (security) // values for adding the related contact DynaValidatorForm qae2 = (DynaValidatorForm) form; // from wizard add clientContact String contactId = (String) request.getAttribute("clientContactViewId"); if (contactId == null) { contactId = (String) (qae2.get("contact")); } // need the project and contact to build the link between contact and project String projectId = StandardCode.getInstance().getCookie("projectAddId", request.getCookies()); Project p = ProjectService.getInstance().getSingleProject(Integer.valueOf(projectId)); ClientContact cc = ClientService.getInstance().getSingleClientContact(Integer.valueOf(contactId)); // insert into db, building link between contact and project ProjectService.getInstance().linkProjectClientContact(p, cc); // Forward control to the specified success URI return (mapping.findForward("Success")); }