01: /*
02: * Copyright (c) Mateusz Prokopowicz. All Rights Reserved.
03: */
04:
05: package com.technoetic.xplanner.actions;
06:
07: import javax.servlet.http.HttpServletRequest;
08: import javax.servlet.http.HttpServletResponse;
09:
10: import org.apache.struts.action.ActionForm;
11: import org.apache.struts.action.ActionForward;
12: import org.apache.struts.action.ActionMapping;
13: import org.apache.struts.action.Action;
14:
15: import com.technoetic.xplanner.Command;
16:
17: /**
18: * User: mprokopowicz
19: * Date: Feb 3, 2006
20: * Time: 11:32:41 AM
21: */
22: public class CommandExecutorAction extends Action {
23: private Command command;
24:
25: public void setTask(Command command) {
26: this .command = command;
27: }
28:
29: public ActionForward execute(ActionMapping mapping,
30: ActionForm form, HttpServletRequest request,
31: HttpServletResponse response) throws Exception {
32: command.execute();
33: String returnto = request
34: .getParameter(EditObjectAction.RETURNTO_PARAM);
35: if (returnto != null) {
36: return new ActionForward(returnto, true);
37: }
38: return mapping.findForward("view/projects");
39: }
40: }
|