1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.struts.chain.commands.servlet;
17
18 import org.apache.struts.action.Action;
19 import org.apache.struts.action.ActionForm;
20 import org.apache.struts.action.ActionMapping;
21 import org.apache.struts.chain.commands.AbstractExecuteAction;
22 import org.apache.struts.chain.contexts.ActionContext;
23 import org.apache.struts.chain.contexts.ServletActionContext;
24 import org.apache.struts.config.ActionConfig;
25 import org.apache.struts.config.ForwardConfig;
26
27 /***
28 * <p>Invoke the appropriate <code>Action</code> for this request, and cache
29 * the returned <code>ActionForward</code>.</p>
30 *
31 * @version $Rev: 421119 $ $Date: 2005-05-07 12:11:38 -0400 (Sat, 07 May 2005)
32 * $
33 */
34 public class ExecuteAction extends AbstractExecuteAction {
35
36
37 /***
38 * <p>Execute the specified <code>Action</code>, and return the resulting
39 * <code>ActionForward</code>.</p>
40 *
41 * @param context The <code>Context</code> for this request
42 * @param action The <code>Action</code> to be executed
43 * @param actionConfig The <code>ActionConfig</code> defining this action
44 * @param actionForm The <code>ActionForm</code> (if any) for this
45 * action
46 * @throws Exception if thrown by the <code>Action</code>
47 */
48 protected ForwardConfig execute(ActionContext context, Action action,
49 ActionConfig actionConfig, ActionForm actionForm)
50 throws Exception {
51 ServletActionContext saContext = (ServletActionContext) context;
52
53 return (action.execute((ActionMapping) actionConfig, actionForm,
54 saContext.getRequest(), saContext.getResponse()));
55 }
56 }