KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > go > teaservlet > util > FilteredHttpServletRequest


1 /* ====================================================================
2  * TeaServlet - Copyright (c) 1999-2000 Walt Disney Internet Group
3  * ====================================================================
4  * The Tea Software License, Version 1.1
5  *
6  * Copyright (c) 2000 Walt Disney Internet Group. All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Walt Disney Internet Group (http://opensource.go.com/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Tea", "TeaServlet", "Kettle", "Trove" and "BeanDoc" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact opensource@dig.com.
31  *
32  * 5. Products derived from this software may not be called "Tea",
33  * "TeaServlet", "Kettle" or "Trove", nor may "Tea", "TeaServlet",
34  * "Kettle", "Trove" or "BeanDoc" appear in their name, without prior
35  * written permission of the Walt Disney Internet Group.
36  *
37  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40  * DISCLAIMED. IN NO EVENT SHALL THE WALT DISNEY INTERNET GROUP OR ITS
41  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
42  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
43  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
44  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
45  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
47  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48  * ====================================================================
49  *
50  * For more information about Tea, please see http://opensource.go.com/.
51  */

52
53 package com.go.teaservlet.util;
54
55 import java.io.*;
56 import java.util.Enumeration JavaDoc;
57 import java.util.Locale JavaDoc;
58 import java.util.Map JavaDoc;
59 import javax.servlet.*;
60 import javax.servlet.http.*;
61
62 /******************************************************************************
63  * A HttpServletRequest wrapper that passes all calls to an internal
64  * HttpServletRequest. This class is designed for subclasses to override or
65  * hook into the behavior of a HttpServletRequest instance.
66  *
67  * @author Brian S O'Neill
68  * @version
69  * <!--$$Revision:--> 16 <!-- $-->, <!--$$JustDate:--> 01/03/20 <!-- $-->
70  * @deprecated Version 2.3 of the Servlet API contains
71  * HttpServletRequestWrapper
72  */

73 public class FilteredHttpServletRequest implements HttpServletRequest {
74     protected final HttpServletRequest mRequest;
75
76     public FilteredHttpServletRequest(HttpServletRequest request) {
77         mRequest = request;
78     }
79
80     // ServletRequest defined methods
81

82     public Object JavaDoc getAttribute(String JavaDoc name) {
83         return mRequest.getAttribute(name);
84     }
85
86     public Enumeration JavaDoc getAttributeNames() {
87         return mRequest.getAttributeNames();
88     }
89
90     public String JavaDoc getCharacterEncoding() {
91         return mRequest.getCharacterEncoding();
92     }
93
94     public void setCharacterEncoding(String JavaDoc encoding)
95         throws UnsupportedEncodingException
96     {
97         mRequest.setCharacterEncoding(encoding);
98     }
99
100     public int getContentLength() {
101         return mRequest.getContentLength();
102     }
103
104     public String JavaDoc getContentType() {
105         return mRequest.getContentType();
106     }
107
108     public ServletInputStream getInputStream() throws IOException {
109         return mRequest.getInputStream();
110     }
111
112     public String JavaDoc getParameter(String JavaDoc name) {
113         return mRequest.getParameter(name);
114     }
115
116     public Enumeration JavaDoc getParameterNames() {
117         return mRequest.getParameterNames();
118     }
119
120     public String JavaDoc[] getParameterValues(String JavaDoc name) {
121         return mRequest.getParameterValues(name);
122     }
123
124     public Map JavaDoc getParameterMap() {
125         return mRequest.getParameterMap();
126     }
127
128     public String JavaDoc getProtocol() {
129         return mRequest.getProtocol();
130     }
131
132     public String JavaDoc getScheme() {
133         return mRequest.getScheme();
134     }
135
136     public String JavaDoc getServerName() {
137         return mRequest.getServerName();
138     }
139
140     public int getServerPort() {
141         return mRequest.getServerPort();
142     }
143
144     public BufferedReader getReader() throws IOException {
145         return mRequest.getReader();
146     }
147
148     public String JavaDoc getRemoteAddr() {
149         return mRequest.getRemoteAddr();
150     }
151
152     public String JavaDoc getRemoteHost() {
153         return mRequest.getRemoteHost();
154     }
155
156     public void setAttribute(String JavaDoc key, Object JavaDoc obj) {
157         mRequest.setAttribute(key, obj);
158     }
159
160     /**
161      * @deprecated
162      */

163     public String JavaDoc getRealPath(String JavaDoc path) {
164         return mRequest.getRealPath(path);
165     }
166
167     // HttpServletRequest defined methods
168

169     public String JavaDoc getAuthType() {
170         return mRequest.getAuthType();
171     }
172
173     public Cookie[] getCookies() {
174         return mRequest.getCookies();
175     }
176
177     public long getDateHeader(String JavaDoc name) {
178         return mRequest.getDateHeader(name);
179     }
180
181     public String JavaDoc getHeader(String JavaDoc name) {
182         return mRequest.getHeader(name);
183     }
184
185     public Enumeration JavaDoc getHeaderNames() {
186         return mRequest.getHeaderNames();
187     }
188
189     public int getIntHeader(String JavaDoc name) {
190         return mRequest.getIntHeader(name);
191     }
192
193     public String JavaDoc getMethod() {
194         return mRequest.getMethod();
195     }
196
197     public String JavaDoc getPathInfo() {
198         return mRequest.getPathInfo();
199     }
200
201     public String JavaDoc getPathTranslated() {
202         return mRequest.getPathTranslated();
203     }
204
205     public String JavaDoc getQueryString() {
206         return mRequest.getQueryString();
207     }
208
209     public String JavaDoc getRemoteUser() {
210         return mRequest.getRemoteUser();
211     }
212
213     public String JavaDoc getRequestedSessionId() {
214         return mRequest.getRequestedSessionId();
215     }
216
217     public String JavaDoc getRequestURI() {
218         return mRequest.getRequestURI();
219     }
220
221     public StringBuffer JavaDoc getRequestURL() {
222         return mRequest.getRequestURL();
223     }
224
225     public String JavaDoc getServletPath() {
226         return mRequest.getServletPath();
227     }
228
229     public HttpSession getSession(boolean create) {
230         return mRequest.getSession(create);
231     }
232
233     public HttpSession getSession() {
234         return mRequest.getSession();
235     }
236
237     public boolean isRequestedSessionIdValid() {
238         return mRequest.isRequestedSessionIdValid();
239     }
240
241     public boolean isRequestedSessionIdFromCookie() {
242         return mRequest.isRequestedSessionIdFromCookie();
243     }
244
245     public boolean isRequestedSessionIdFromURL() {
246         return mRequest.isRequestedSessionIdFromURL();
247     }
248
249     public void removeAttribute(String JavaDoc name) {
250         mRequest.removeAttribute(name);
251     }
252
253     public String JavaDoc getContextPath() {
254         return mRequest.getContextPath();
255     }
256
257     public boolean isSecure() {
258         return mRequest.isSecure();
259     }
260
261     public boolean isUserInRole(String JavaDoc role) {
262         return mRequest.isUserInRole(role);
263     }
264
265     public java.security.Principal JavaDoc getUserPrincipal() {
266         return mRequest.getUserPrincipal();
267     }
268
269     public Enumeration JavaDoc getHeaders(String JavaDoc name) {
270         return mRequest.getHeaders(name);
271     }
272
273     public Locale JavaDoc getLocale() {
274         return mRequest.getLocale();
275     }
276
277     public Enumeration JavaDoc getLocales() {
278         return mRequest.getLocales();
279     }
280
281     public RequestDispatcher getRequestDispatcher(String JavaDoc path) {
282         return mRequest.getRequestDispatcher(path);
283     }
284
285     /**
286      * @deprecated
287      */

288     public boolean isRequestedSessionIdFromUrl() {
289         return mRequest.isRequestedSessionIdFromUrl();
290     }
291
292     public String JavaDoc toString() {
293         return mRequest.toString();
294     }
295 }
296
Popular Tags