1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
package org.demosys.task; |
7 |
|
import javax.servlet.http.HttpServletRequest; |
8 |
|
import javax.servlet.http.HttpServletResponse; |
9 |
|
import org.apache.struts.action.Action; |
10 |
|
import org.apache.struts.action.ActionForm; |
11 |
|
import org.apache.struts.action.ActionForward; |
12 |
|
import org.apache.struts.action.ActionMapping; |
13 |
|
import org.demosys.web.ServiceLocator; |
14 |
|
|
15 |
|
|
16 |
|
|
17 |
0 |
public class CreationTaskAction extends Action { |
18 |
|
public ActionForward execute(ActionMapping mapping, ActionForm objForm, |
19 |
|
HttpServletRequest req, HttpServletResponse res) { |
20 |
0 |
CreationTaskForm form = (CreationTaskForm)objForm; |
21 |
0 |
String result = null; |
22 |
|
|
23 |
|
try { |
24 |
0 |
ServiceLocator.getServiceLocator().getTaskService().newTask(form.toTaskView()); |
25 |
0 |
result = "success"; |
26 |
0 |
} |
27 |
|
catch (CreationTaskException e) { |
28 |
0 |
e.printStackTrace(); |
29 |
0 |
result = "failure"; |
30 |
0 |
} |
31 |
|
|
32 |
0 |
return mapping.findForward(result); |
33 |
|
} |
34 |
|
} |