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.chain.commands.AbstractPerformInclude;
19 import org.apache.struts.chain.contexts.ActionContext;
20 import org.apache.struts.chain.contexts.ServletActionContext;
21
22 import javax.servlet.RequestDispatcher;
23 import javax.servlet.http.HttpServletRequest;
24
25 /***
26 * <p>Perform forwarding or redirection based on the specified include uri (if
27 * any).</p>
28 *
29 * @version $Rev: 421119 $ $Date: 2005-11-09 00:11:45 -0500 (Wed, 09 Nov 2005)
30 * $
31 */
32 public class PerformInclude extends AbstractPerformInclude {
33
34
35 /***
36 * <p>Perform the appropriate processing on the specified include
37 * uri.</p>
38 *
39 * @param context The context for this request
40 * @param uri The uri to be included
41 */
42 protected void perform(ActionContext context, String uri)
43 throws Exception {
44 ServletActionContext swcontext = (ServletActionContext) context;
45
46 HttpServletRequest request = swcontext.getRequest();
47
48 RequestDispatcher rd = swcontext.getContext().getRequestDispatcher(uri);
49
50 rd.forward(request, swcontext.getResponse());
51 }
52 }