1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
package org.demosys.web.iteration.action; |
7 |
|
import javax.servlet.http.Cookie; |
8 |
|
import javax.servlet.http.HttpServletRequest; |
9 |
|
import javax.servlet.http.HttpServletResponse; |
10 |
|
import org.apache.struts.action.Action; |
11 |
|
import org.apache.struts.action.ActionForm; |
12 |
|
import org.apache.struts.action.ActionForward; |
13 |
|
import org.apache.struts.action.ActionMapping; |
14 |
|
import org.demosys.web.ServiceLocator; |
15 |
|
import org.demosys.web.iteration.CreateIterationException; |
16 |
|
import org.demosys.web.iteration.IterationForm; |
17 |
|
|
18 |
|
|
19 |
0 |
public class UpdateIterationAction extends Action { |
20 |
|
public ActionForward execute(ActionMapping mapping, ActionForm objForm, |
21 |
|
HttpServletRequest req, HttpServletResponse res) { |
22 |
0 |
IterationForm form = (IterationForm)objForm; |
23 |
|
|
24 |
0 |
String result = null; |
25 |
|
|
26 |
|
try { |
27 |
0 |
ServiceLocator.getServiceLocator().getIterationService().updateIteration(form |
28 |
|
.toIterationView()); |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
0 |
result = "success"; |
36 |
0 |
} |
37 |
|
catch (CreateIterationException e) { |
38 |
0 |
e.printStackTrace(); |
39 |
0 |
result = "failure"; |
40 |
0 |
} |
41 |
|
|
42 |
0 |
return mapping.findForward(result); |
43 |
|
} |
44 |
|
} |