This project has retired. For details please refer to its
Attic page.
JspPrintWriterAdapter xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.tiles.request.jsp;
22
23 import java.io.IOException;
24 import java.io.PrintWriter;
25
26 import javax.servlet.jsp.JspWriter;
27
28 import org.slf4j.Logger;
29 import org.slf4j.LoggerFactory;
30
31
32
33
34
35
36 public class JspPrintWriterAdapter extends PrintWriter {
37
38
39
40
41 private JspWriter writer;
42
43
44
45
46 private final Logger log = LoggerFactory.getLogger(this.getClass());
47
48
49
50
51
52
53 public JspPrintWriterAdapter(JspWriter writer) {
54 super(writer);
55 this.writer = writer;
56 }
57
58
59
60
61
62
63 public JspWriter getJspWriter() {
64 return writer;
65 }
66
67
68 @Override
69 public PrintWriter append(char c) {
70 try {
71 writer.append(c);
72 } catch (IOException e) {
73 log.error("Error when writing in JspWriter", e);
74 setError();
75 }
76 return this;
77 }
78
79
80 @Override
81 public PrintWriter append(CharSequence csq, int start, int end) {
82 try {
83 writer.append(csq, start, end);
84 } catch (IOException e) {
85 log.error("Error when writing in JspWriter", e);
86 setError();
87 }
88 return this;
89 }
90
91
92 @Override
93 public PrintWriter append(CharSequence csq) {
94 try {
95 writer.append(csq);
96 } catch (IOException e) {
97 log.error("Error when writing in JspWriter", e);
98 setError();
99 }
100 return this;
101 }
102
103
104 @Override
105 public void close() {
106 try {
107 writer.close();
108 } catch (IOException e) {
109 log.error("Error when writing in JspWriter", e);
110 setError();
111 }
112 }
113
114
115 @Override
116 public void flush() {
117 try {
118 writer.flush();
119 } catch (IOException e) {
120 log.error("Error when writing in JspWriter", e);
121 setError();
122 }
123 }
124
125
126 @Override
127 public void print(boolean b) {
128 try {
129 writer.print(b);
130 } catch (IOException e) {
131 log.error("Error when writing in JspWriter", e);
132 setError();
133 }
134 }
135
136
137 @Override
138 public void print(char c) {
139 try {
140 writer.print(c);
141 } catch (IOException e) {
142 log.error("Error when writing in JspWriter", e);
143 setError();
144 }
145 }
146
147
148 @Override
149 public void print(char[] s) {
150 try {
151 writer.print(s);
152 } catch (IOException e) {
153 log.error("Error when writing in JspWriter", e);
154 setError();
155 }
156 }
157
158
159 @Override
160 public void print(double d) {
161 try {
162 writer.print(d);
163 } catch (IOException e) {
164 log.error("Error when writing in JspWriter", e);
165 setError();
166 }
167 }
168
169
170 @Override
171 public void print(float f) {
172 try {
173 writer.print(f);
174 } catch (IOException e) {
175 log.error("Error when writing in JspWriter", e);
176 setError();
177 }
178 }
179
180
181 @Override
182 public void print(int i) {
183 try {
184 writer.print(i);
185 } catch (IOException e) {
186 log.error("Error when writing in JspWriter", e);
187 setError();
188 }
189 }
190
191
192 @Override
193 public void print(long l) {
194 try {
195 writer.print(l);
196 } catch (IOException e) {
197 log.error("Error when writing in JspWriter", e);
198 setError();
199 }
200 }
201
202
203 @Override
204 public void print(Object obj) {
205 try {
206 writer.print(obj);
207 } catch (IOException e) {
208 log.error("Error when writing in JspWriter", e);
209 setError();
210 }
211 }
212
213
214 @Override
215 public void print(String s) {
216 try {
217 writer.print(s);
218 } catch (IOException e) {
219 log.error("Error when writing in JspWriter", e);
220 setError();
221 }
222 }
223
224
225 @Override
226 public void println() {
227 try {
228 writer.println();
229 } catch (IOException e) {
230 log.error("Error when writing in JspWriter", e);
231 setError();
232 }
233 }
234
235
236 @Override
237 public void println(boolean x) {
238 try {
239 writer.println(x);
240 } catch (IOException e) {
241 log.error("Error when writing in JspWriter", e);
242 setError();
243 }
244 }
245
246
247 @Override
248 public void println(char x) {
249 try {
250 writer.println(x);
251 } catch (IOException e) {
252 log.error("Error when writing in JspWriter", e);
253 setError();
254 }
255 }
256
257
258 @Override
259 public void println(char[] x) {
260 try {
261 writer.println(x);
262 } catch (IOException e) {
263 log.error("Error when writing in JspWriter", e);
264 setError();
265 }
266 }
267
268
269 @Override
270 public void println(double x) {
271 try {
272 writer.println(x);
273 } catch (IOException e) {
274 log.error("Error when writing in JspWriter", e);
275 setError();
276 }
277 }
278
279
280 @Override
281 public void println(float x) {
282 try {
283 writer.println(x);
284 } catch (IOException e) {
285 log.error("Error when writing in JspWriter", e);
286 setError();
287 }
288 }
289
290
291 @Override
292 public void println(int x) {
293 try {
294 writer.println(x);
295 } catch (IOException e) {
296 log.error("Error when writing in JspWriter", e);
297 setError();
298 }
299 }
300
301
302 @Override
303 public void println(long x) {
304 try {
305 writer.println(x);
306 } catch (IOException e) {
307 log.error("Error when writing in JspWriter", e);
308 setError();
309 }
310 }
311
312
313 @Override
314 public void println(Object x) {
315 try {
316 writer.println(x);
317 } catch (IOException e) {
318 log.error("Error when writing in JspWriter", e);
319 setError();
320 }
321 }
322
323
324 @Override
325 public void println(String x) {
326 try {
327 writer.println(x);
328 } catch (IOException e) {
329 log.error("Error when writing in JspWriter", e);
330 setError();
331 }
332 }
333
334
335 @Override
336 public void write(char[] buf, int off, int len) {
337 try {
338 writer.write(buf, off, len);
339 } catch (IOException e) {
340 log.error("Error when writing in JspWriter", e);
341 setError();
342 }
343 }
344
345
346 @Override
347 public void write(char[] buf) {
348 try {
349 writer.write(buf);
350 } catch (IOException e) {
351 log.error("Error when writing in JspWriter", e);
352 setError();
353 }
354 }
355
356
357 @Override
358 public void write(int c) {
359 try {
360 writer.write(c);
361 } catch (IOException e) {
362 log.error("Error when writing in JspWriter", e);
363 setError();
364 }
365 }
366
367
368 @Override
369 public void write(String s, int off, int len) {
370 try {
371 writer.write(s, off, len);
372 } catch (IOException e) {
373 log.error("Error when writing in JspWriter", e);
374 setError();
375 }
376 }
377
378
379 @Override
380 public void write(String s) {
381 try {
382 writer.write(s);
383 } catch (IOException e) {
384 log.error("Error when writing in JspWriter", e);
385 setError();
386 }
387 }
388 }