1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.struts.action;
19
20 import org.apache.struts.upload.MultipartRequestHandler;
21
22 import java.io.Serializable;
23
24 /***
25 * <p>Provide a wrapper around an {@link ActionServlet} to expose only those
26 * methods needed by other objects. When used with an {@link ActionForm},
27 * subclasses must be careful that they do not return an object with public
28 * getters and setters that could be exploited by automatic population of
29 * properties.</p>
30 *
31 * @version $Rev: 421119 $ $Date: 2005-05-07 12:11:38 -0400 (Sat, 07 May 2005)
32 * $
33 * @since Struts 1.0.1
34 */
35 public class ActionServletWrapper implements Serializable {
36 /***
37 * <p>The servlet instance to which we are attached.</p>
38 */
39 protected transient ActionServlet servlet = null;
40
41 /***
42 * <p>Create object and set <code>servlet</code> property.</p>
43 *
44 * @param servlet <code>ActionServlet</code> to wrap
45 */
46 public ActionServletWrapper(ActionServlet servlet) {
47 super();
48 this.servlet = servlet;
49 }
50
51 /***
52 * <p>Set servlet to a <code>MultipartRequestHandler</code>.</p>
53 *
54 * @param object The MultipartRequestHandler
55 */
56 public void setServletFor(MultipartRequestHandler object) {
57 object.setServlet(this.servlet);
58
59
60
61
62 }
63 }