01: //** Copyright Statement ***************************************************
02: //The Salmon Open Framework for Internet Applications (SOFIA)
03: // Copyright (C) 1999 - 2002, Salmon LLC
04: //
05: // This program is free software; you can redistribute it and/or
06: // modify it under the terms of the GNU General Public License version 2
07: // as published by the Free Software Foundation;
08: //
09: // This program is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU General Public License
15: // along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: //
18: // For more information please visit http://www.salmonllc.com
19: //** End Copyright Statement ***************************************************
20: package com.salmonllc.html;
21:
22: import java.io.OutputStream;
23: import java.io.PrintWriter;
24:
25: /**
26: * This class is a wrapper used by internal processes in the framework and isn't intended to be used directly. For more information see HttpServletResponse in the JSDK documentation.
27: */
28:
29: public class HttpServletResponseDummy extends
30: HttpServletResponseWrapper {
31: class DummyOutputStream extends OutputStream {
32: public void close() {
33: };
34:
35: public void flush() {
36: };
37:
38: public void write(byte[] b) {
39: write(b, 0, b.length);
40:
41: };
42:
43: public void write(byte[] b, int off, int len) {
44: for (int i = off; i < len; i++)
45: write(b[i]);
46: };
47:
48: public void write(int b) {
49: //System.err.print((char) b);
50: };
51: }
52:
53: /**
54: * HttpServletResponseDummy constructor comment.
55: * @param res javax.servlet.http.HttpServletResponse
56: * @param page com.salmonllc.html.HtmlPageBase
57: */
58: public HttpServletResponseDummy(
59: javax.servlet.http.HttpServletResponse res,
60: HtmlPageBase page) {
61: super (res, page);
62: }
63:
64: public java.io.PrintWriter getWriter() throws java.io.IOException {
65: return new PrintWriter(new DummyOutputStream());
66: }
67:
68: public void flushBuffer() throws java.io.IOException {
69:
70: }
71: }
|