File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
grails-web/src/main/groovy/org/codehaus/groovy/grails/web Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1414 */
1515package org .codehaus .groovy .grails .web .sitemesh ;
1616
17+ import groovy .lang .Writable ;
18+
1719import java .io .IOException ;
1820import java .io .PrintWriter ;
1921import java .io .Writer ;
2022
23+ import org .codehaus .groovy .grails .web .util .GrailsPrintWriter ;
2124import org .codehaus .groovy .grails .web .util .GrailsPrintWriterAdapter ;
25+ import org .codehaus .groovy .grails .web .util .StreamCharBuffer ;
2226
2327public class GrailsRoutablePrintWriter extends GrailsPrintWriterAdapter {
2428
@@ -65,6 +69,7 @@ private PrintWriter getDestination() {
6569 setError ();
6670 }
6771 super .out = destination ;
72+ super .setTarget (destination );
6873 }
6974 return destination ;
7075 }
@@ -279,4 +284,22 @@ public void blockFlushAndClose() {
279284 this .blockClose = true ;
280285 this .blockFlush = true ;
281286 }
287+
288+ @ Override
289+ public GrailsPrintWriter leftShift (Object value ) throws IOException {
290+ getDestination ();
291+ return super .leftShift (value );
292+ }
293+
294+ @ Override
295+ public GrailsPrintWriter leftShift (StreamCharBuffer otherBuffer ) {
296+ getDestination ();
297+ return super .leftShift (otherBuffer );
298+ }
299+
300+ @ Override
301+ public GrailsPrintWriter leftShift (Writable writable ) {
302+ getDestination ();
303+ return super .leftShift (writable );
304+ }
282305}
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ public class GrailsPrintWriterAdapter extends PrintWriter implements GrailsWrapp
3131
3232 public GrailsPrintWriterAdapter (Writer wrapped ) {
3333 super (new NullWriter ());
34+ setTarget (wrapped );
35+ }
36+
37+ public void setTarget (Writer wrapped ) {
3438 if (wrapped instanceof GrailsPrintWriter ) {
3539 this .target = ((GrailsPrintWriter )wrapped );
3640 }
You can’t perform that action at this time.
0 commit comments