KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > servlets > InvokerHttpRequest


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18
19 package org.apache.catalina.servlets;
20
21
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletRequestWrapper JavaDoc;
24
25
26 /**
27  * Wrapper around a <code>javax.servlet.http.HttpServletRequest</code>
28  * utilized when <code>InvokerServlet</code> processes the initial request
29  * for an invoked servlet. Subsequent requests will be mapped directly
30  * to the servlet, because a new servlet mapping will have been created.
31  *
32  * @author Craig R. McClanahan
33  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
34  */

35
36 class InvokerHttpRequest extends HttpServletRequestWrapper JavaDoc {
37
38
39     // ----------------------------------------------------------- Constructors
40

41
42     /**
43      * Construct a new wrapped request around the specified servlet request.
44      *
45      * @param request The servlet request being wrapped
46      */

47     public InvokerHttpRequest(HttpServletRequest JavaDoc request) {
48
49         super(request);
50         this.pathInfo = request.getPathInfo();
51         this.pathTranslated = request.getPathTranslated();
52         this.requestURI = request.getRequestURI();
53         this.servletPath = request.getServletPath();
54
55     }
56
57
58     // ----------------------------------------------------- Instance Variables
59

60
61     /**
62      * Descriptive information about this implementation.
63      */

64     protected static final String JavaDoc info =
65         "org.apache.catalina.servlets.InvokerHttpRequest/1.0";
66
67
68     /**
69      * The path information for this request.
70      */

71     protected String JavaDoc pathInfo = null;
72
73
74     /**
75      * The translated path information for this request.
76      */

77     protected String JavaDoc pathTranslated = null;
78
79
80     /**
81      * The request URI for this request.
82      */

83     protected String JavaDoc requestURI = null;
84
85
86     /**
87      * The servlet path for this request.
88      */

89     protected String JavaDoc servletPath = null;
90
91
92     // --------------------------------------------- HttpServletRequest Methods
93

94
95     /**
96      * Override the <code>getPathInfo()</code> method of the wrapped request.
97      */

98     public String JavaDoc getPathInfo() {
99
100         return (this.pathInfo);
101
102     }
103
104
105     /**
106      * Override the <code>getPathTranslated()</code> method of the
107      * wrapped request.
108      */

109     public String JavaDoc getPathTranslated() {
110
111         return (this.pathTranslated);
112
113     }
114
115
116     /**
117      * Override the <code>getRequestURI()</code> method of the wrapped request.
118      */

119     public String JavaDoc getRequestURI() {
120
121         return (this.requestURI);
122
123     }
124
125
126     /**
127      * Override the <code>getServletPath()</code> method of the wrapped
128      * request.
129      */

130     public String JavaDoc getServletPath() {
131
132         return (this.servletPath);
133
134     }
135
136
137     // -------------------------------------------------------- Package Methods
138

139
140
141     /**
142      * Return descriptive information about this implementation.
143      */

144     public String JavaDoc getInfo() {
145
146         return (info);
147
148     }
149
150
151     /**
152      * Set the path information for this request.
153      *
154      * @param pathInfo The new path info
155      */

156     void setPathInfo(String JavaDoc pathInfo) {
157
158         this.pathInfo = pathInfo;
159
160     }
161
162
163     /**
164      * Set the translated path info for this request.
165      *
166      * @param pathTranslated The new translated path info
167      */

168     void setPathTranslated(String JavaDoc pathTranslated) {
169
170         this.pathTranslated = pathTranslated;
171
172     }
173
174
175     /**
176      * Set the request URI for this request.
177      *
178      * @param requestURI The new request URI
179      */

180     void setRequestURI(String JavaDoc requestURI) {
181
182         this.requestURI = requestURI;
183
184     }
185
186
187     /**
188      * Set the servlet path for this request.
189      *
190      * @param servletPath The new servlet path
191      */

192     void setServletPath(String JavaDoc servletPath) {
193
194         this.servletPath = servletPath;
195
196     }
197
198
199 }
200
Popular Tags