incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r939219 - /sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java
Date Thu, 29 Apr 2010 07:08:27 GMT
Author: cziegeler
Date: Thu Apr 29 07:08:27 2010
New Revision: 939219

URL: http://svn.apache.org/viewvc?rev=939219&view=rev
Log:
Readd accidentally removed code

Modified:
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java?rev=939219&r1=939218&r2=939219&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java
Thu Apr 29 07:08:27 2010
@@ -18,6 +18,7 @@ package org.apache.sling.rewriter.impl;
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.io.Writer;
 import java.util.Iterator;
 import java.util.List;
 
@@ -79,6 +80,26 @@ class RewriterResponse
      * @see javax.servlet.ServletResponseWrapper#getWriter()
      */
     public PrintWriter getWriter() throws IOException {
+        if ( this.processor != null && this.writer == null ) {
+            return new PrintWriter(new Writer() {
+
+                @Override
+                public void close() throws IOException {
+                    // nothing to do
+                }
+
+                @Override
+                public void flush() throws IOException {
+                    // nothing to do
+                }
+
+                @Override
+                public void write(char[] cbuf, int off, int len)
+                throws IOException {
+                    // nothing to do
+                }
+             });
+        }
         if (writer == null) {
             this.processor = this.getProcessor();
             if ( this.processor != null ) {



Mime
View raw message