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.*;
11 import org.demosys.web.ServiceLocator;
12 import org.demosys.web.iteration.IterationForm;
13 import org.demosys.web.iteration.IterationService;
14 import org.demosys.web.iteration.UnknownIterationException;
15 /***
16 */
17 public class DeleteIterationAction extends Action {
18 public ActionForward execute(ActionMapping mapping, ActionForm objForm,
19 HttpServletRequest request, HttpServletResponse res) {
20 IterationForm form = (IterationForm)objForm;
21
22 // Get user id from request parameter
23 String title = request.getParameter("title");
24
25 try {
26 IterationService iterationService =
27 ServiceLocator.getServiceLocator().getIterationService();
28 iterationService.deleteIteration(title);
29 return mapping.findForward("success");
30 }
31 catch (UnknownIterationException e) {
32 ActionErrors errors = new ActionErrors();
33 errors.add("title", new ActionError("iteration.delete.unknown.iteration"));
34 saveErrors(request, errors);
35 return mapping.findForward("failure");
36 }
37 }
38 }
This page was automatically generated by Maven