01: /*
02: * Copyright 2005-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
05: * in compliance with the License. You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software distributed under the License
10: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11: * or implied. See the License for the specific language governing permissions and limitations under
12: * the License.
13: */
14:
15: package org.strecks.context;
16:
17: import javax.servlet.ServletContext;
18: import javax.servlet.http.HttpServletRequest;
19: import javax.servlet.http.HttpServletResponse;
20:
21: import org.apache.struts.action.ActionForm;
22: import org.apache.struts.action.ActionMapping;
23: import org.strecks.util.Assert;
24:
25: /**
26: * The default <code>ActionContext</code> implementation
27: * @author Phil Zoio
28: */
29: public class ActionContextImpl implements ActionContext {
30:
31: private HttpServletRequest request;
32:
33: private HttpServletResponse response;
34:
35: private ServletContext context;
36:
37: private ActionForm form;
38:
39: private ActionMapping mapping;
40:
41: public ActionContextImpl(HttpServletRequest request,
42: HttpServletResponse response, ServletContext context,
43: ActionForm form, ActionMapping mapping) {
44: super ();
45: Assert.notNull(request);
46: Assert.notNull(response);
47: Assert.notNull(context);
48: Assert.notNull(mapping);
49:
50: this .request = request;
51: this .response = response;
52: this .context = context;
53: this .form = form;
54: this .mapping = mapping;
55: }
56:
57: public ServletContext getContext() {
58: return context;
59: }
60:
61: public ActionForm getForm() {
62: return form;
63: }
64:
65: public ActionMapping getMapping() {
66: return mapping;
67: }
68:
69: public HttpServletRequest getRequest() {
70: return request;
71: }
72:
73: public HttpServletResponse getResponse() {
74: return response;
75: }
76:
77: }
|