1 /*
2 * Demosys.
3 *
4 * Terms of license - http://opensource.org/licenses/apachepl.php
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 public class UpdateIterationAction extends Action {
20 public ActionForward execute(ActionMapping mapping, ActionForm objForm,
21 HttpServletRequest req, HttpServletResponse res) {
22 IterationForm form = (IterationForm)objForm;
23
24 String result = null;
25
26 try {
27 ServiceLocator.getServiceLocator().getIterationService().updateIteration(form
28 .toIterationView());
29
30 /* Cookie c = new Cookie("userCookie", "1234");
31 c.setMaxAge(365*24*60*60);
32
33 res.addCookie(c);
34 */
35 result = "success";
36 }
37 catch (CreateIterationException e) {
38 e.printStackTrace();
39 result = "failure";
40 }
41
42 return mapping.findForward(result);
43 }
44 }
This page was automatically generated by Maven