01: /*
02: * Copyright 2004-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.springframework.webflow.executor.struts;
17:
18: import javax.servlet.ServletContext;
19: import javax.servlet.http.HttpServletRequest;
20: import javax.servlet.http.HttpServletResponse;
21:
22: import org.apache.struts.action.ActionForm;
23: import org.apache.struts.action.ActionMapping;
24: import org.springframework.webflow.context.servlet.ServletExternalContext;
25:
26: /**
27: * Provides consistent access to a Struts environment from within the Spring Web
28: * Flow system. Represents the context of a request into SWF from Struts.
29: *
30: * @author Keith Donald
31: */
32: public class StrutsExternalContext extends ServletExternalContext {
33:
34: /**
35: * The Struts action mapping associated with this request.
36: */
37: private ActionMapping actionMapping;
38:
39: /**
40: * The Struts action form associated with this request.
41: */
42: private ActionForm actionForm;
43:
44: /**
45: * Creates a new Struts external context.
46: * @param mapping the action mapping
47: * @param form the action form
48: * @param context the servlet context
49: * @param request the request
50: * @param response the response
51: */
52: public StrutsExternalContext(ActionMapping mapping,
53: ActionForm form, ServletContext context,
54: HttpServletRequest request, HttpServletResponse response) {
55: super (context, request, response);
56: this .actionMapping = mapping;
57: this .actionForm = form;
58: }
59:
60: /**
61: * Returns the action form.
62: */
63: public ActionForm getActionForm() {
64: return actionForm;
65: }
66:
67: /**
68: * Returns the action mapping.
69: */
70: public ActionMapping getActionMapping() {
71: return actionMapping;
72: }
73: }
|