1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package examples.simple;
20
21 import javax.servlet.http.HttpServletRequest;
22 import javax.servlet.http.HttpServletResponse;
23
24 import org.apache.struts.action.Action;
25 import org.apache.struts.action.ActionForm;
26 import org.apache.struts.action.ActionForward;
27 import org.apache.struts.action.ActionMapping;
28
29 /***
30 * Retrieve and process data from the submitted form
31 *
32 * @version $Rev: 421486 $ $Date: 2006-07-12 20:37:08 -0700 (Wed, 12 Jul 2006) $
33 */
34 public class ProcessSimpleAction extends Action {
35
36
37
38 /***
39 * Constructor for ProcessFormAction.
40 */
41 public ProcessSimpleAction() {
42 super();
43 }
44
45
46
47 /***
48 * Process the request and return an <code>ActionForward</code> instance
49 * describing where and how control should be forwarded, or
50 * <code>null</code>if the response has already been completed.
51 *
52 * @param mapping The ActionMapping used to select this instance
53 * @param form The optional ActionForm bean for this request (if any)
54 * @param request The HTTP request we are processing
55 * @param response The HTTP response we are creating
56 *
57 * @exception Exception if the application logic throws an exception
58 *
59 * @return the ActionForward for the next view
60 */
61 public ActionForward execute(
62 ActionMapping mapping,
63 ActionForm form,
64 HttpServletRequest request,
65 HttpServletResponse response)
66 throws Exception {
67
68
69
70 if (isCancelled(request)) {
71 return mapping.findForward("home");
72 }
73
74
75 return mapping.findForward("success");
76 }
77
78 }