KickJava   Java API By Example, From Geeks To Geeks.

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


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 javax.servlet.*;
59 import javax.servlet.http.*;
60
61 /******************************************************************************
62  * A HttpServletResponse wrapper that passes all calls to an internal
63  * HttpServletResponse. This class is designed for subclasses to override or
64  * hook into the behavior of a HttpServletResponse instance.
65  *
66  * @author Brian S O'Neill
67  * @version
68  * <!--$$Revision:--> 17 <!-- $-->, <!--$$JustDate:--> 01/03/20 <!-- $-->
69  * @deprecated Version 2.3 of the Servlet API contains
70  * HttpServletResponseWrapper
71  */

72 public class FilteredHttpServletResponse implements HttpServletResponse {
73     protected final HttpServletResponse mResponse;
74
75     public FilteredHttpServletResponse(HttpServletResponse response) {
76         mResponse = response;
77     }
78
79     // ServletResponse defined methods
80

81     public String JavaDoc getCharacterEncoding() {
82         return mResponse.getCharacterEncoding();
83     }
84
85     public ServletOutputStream getOutputStream() throws IOException {
86         return mResponse.getOutputStream();
87     }
88
89     public PrintWriter getWriter() throws IOException {
90         return mResponse.getWriter();
91     }
92
93     public void setContentLength(int length) {
94         mResponse.setContentLength(length);
95     }
96
97     public void setContentType(String JavaDoc type) {
98         mResponse.setContentType(type);
99     }
100
101     // HttpServletResponse defined methods
102

103     public void addCookie(Cookie cookie) {
104         mResponse.addCookie(cookie);
105     }
106
107     public boolean containsHeader(String JavaDoc name) {
108         return mResponse.containsHeader(name);
109     }
110
111     public String JavaDoc encodeURL(String JavaDoc url) {
112         return mResponse.encodeURL(url);
113     }
114
115     public String JavaDoc encodeRedirectURL(String JavaDoc url) {
116         return mResponse.encodeRedirectURL(url);
117     }
118
119     /**
120      * @deprecated
121      */

122     public String JavaDoc encodeUrl(String JavaDoc url) {
123         return mResponse.encodeUrl(url);
124     }
125
126     /**
127      * @deprecated
128      */

129     public String JavaDoc encodeRedirectUrl(String JavaDoc url) {
130         return mResponse.encodeRedirectUrl(url);
131     }
132
133     public void sendError(int sc, String JavaDoc msg) throws IOException {
134         mResponse.sendError(sc, msg);
135     }
136
137     public void sendError(int sc) throws IOException {
138         mResponse.sendError(sc);
139     }
140
141     public void sendRedirect(String JavaDoc location) throws IOException {
142         mResponse.sendRedirect(location);
143     }
144
145     public void setDateHeader(String JavaDoc name, long date) {
146         mResponse.setDateHeader(name, date);
147     }
148
149     public void setHeader(String JavaDoc name, String JavaDoc value) {
150         mResponse.setHeader(name, value);
151     }
152
153     public void setIntHeader(String JavaDoc name, int value) {
154         mResponse.setIntHeader(name, value);
155     }
156
157     public void setStatus(int sc) {
158         mResponse.setStatus(sc);
159     }
160
161     public void setBufferSize(int size) {
162         mResponse.setBufferSize(size);
163     }
164
165     public void setLocale(Locale JavaDoc locale) {
166         mResponse.setLocale(locale);
167     }
168
169     public void addDateHeader(String JavaDoc name, long date) {
170         mResponse.addDateHeader(name,date);
171     }
172
173     public void addIntHeader(String JavaDoc name, int value) {
174         mResponse.addIntHeader(name,value);
175     }
176
177     public void flushBuffer() throws IOException {
178         mResponse.flushBuffer();
179     }
180
181     public void resetBuffer() {
182         mResponse.resetBuffer();
183     }
184
185     public int getBufferSize() {
186         return mResponse.getBufferSize();
187     }
188
189     public boolean isCommitted() {
190         return mResponse.isCommitted();
191     }
192
193     public void reset() {
194         mResponse.reset();
195     }
196
197     public void addHeader(String JavaDoc name, String JavaDoc value) {
198         mResponse.addHeader(name, value);
199     }
200
201     public Locale JavaDoc getLocale() {
202         return mResponse.getLocale();
203     }
204
205     /**
206      * @deprecated
207      */

208     public void setStatus(int sc, String JavaDoc msg) {
209         mResponse.setStatus(sc, msg);
210     }
211
212     public String JavaDoc toString() {
213         return mResponse.toString();
214     }
215 }
216
Popular Tags