1 /*
2 * Demosys.
3 *
4 * Terms of license - http://opensource.org/licenses/apachepl.php
5 */
6 package org.demosys.web.story.action;
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 import org.demosys.web.story.CreateStoryException;
15
16 /***
17 */
18 public class NewStoryAction extends Action {
19 public ActionForward execute(ActionMapping mapping, ActionForm objForm,
20 HttpServletRequest req, HttpServletResponse res) {
21 NewStoryForm form = (NewStoryForm)objForm;
22
23 String result = null;
24
25 try {
26 ServiceLocator.getServiceLocator().getStoryService().newStory(form
27 .toStoryView());
28 result = "success";
29 }
30 catch (CreateStoryException e) {
31 e.printStackTrace();
32 result = "failure";
33 }
34
35 return mapping.findForward(result);
36 }
37 }
This page was automatically generated by Maven