KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > executor > struts > StrutsExternalContext


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 JavaDoc;
19 import javax.servlet.http.HttpServletRequest JavaDoc;
20 import javax.servlet.http.HttpServletResponse JavaDoc;
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, ActionForm form, ServletContext JavaDoc context,
53             HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
54         super(context, request, response);
55         this.actionMapping = mapping;
56         this.actionForm = form;
57     }
58
59     /**
60      * Returns the action form.
61      */

62     public ActionForm getActionForm() {
63         return actionForm;
64     }
65
66     /**
67      * Returns the action mapping.
68      */

69     public ActionMapping getActionMapping() {
70         return actionMapping;
71     }
72 }
Popular Tags