You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ba...@apache.org on 2007/05/22 01:23:29 UTC
svn commit: r540352 -
/myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/application/jsp/ViewResponseWrapper.java
Author: baranda
Date: Mon May 21 16:23:29 2007
New Revision: 540352
URL: http://svn.apache.org/viewvc?view=rev&rev=540352
Log:
Removed System.out.println
Reformated sections of class to follow the code guidelines
Added svn:keywords
Modified:
myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/application/jsp/ViewResponseWrapper.java (contents, props changed)
Modified: myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/application/jsp/ViewResponseWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/application/jsp/ViewResponseWrapper.java?view=diff&rev=540352&r1=540351&r2=540352
==============================================================================
--- myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/application/jsp/ViewResponseWrapper.java (original)
+++ myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/application/jsp/ViewResponseWrapper.java Mon May 21 16:23:29 2007
@@ -55,24 +55,31 @@
}
public void flushToWrappedResponse() throws IOException
- { if (_charArrayWriter != null) {
+ {
+ if (_charArrayWriter != null)
+ {
_charArrayWriter.writeTo(getResponse().getWriter());
_charArrayWriter.reset();
_writer.flush();
- } else if (_byteArrayWriter != null) {
- System.out.println("BYTE ARRAY WRITER");
+ }
+ else if (_byteArrayWriter != null)
+ {
getResponse().getOutputStream().write(_byteArrayWriter.toByteArray());
_byteArrayWriter.reset();
_byteArrayWriter.flush();
}
}
- public void flushToWriter(Writer writer) throws IOException {
- if (_charArrayWriter != null) {
+ public void flushToWriter(Writer writer) throws IOException
+ {
+ if (_charArrayWriter != null)
+ {
_charArrayWriter.writeTo(getResponse().getWriter());
_charArrayWriter.reset();
_writer.flush();
- } else if (_byteArrayWriter != null) {
+ }
+ else if (_byteArrayWriter != null)
+ {
getResponse().getOutputStream().write(_byteArrayWriter.toByteArray());
_byteArrayWriter.reset();
_byteArrayWriter.flush();
@@ -81,9 +88,11 @@
}
@Override
- public ServletOutputStream getOutputStream() throws IOException {
- if (_charArrayWriter != null ) throw new IllegalStateException();
- if (_byteArrayWriter == null ) {
+ public ServletOutputStream getOutputStream() throws IOException
+ {
+ if (_charArrayWriter != null) throw new IllegalStateException();
+ if (_byteArrayWriter == null)
+ {
_byteArrayWriter = new WrappedServletOutputStream();
}
return _byteArrayWriter;
@@ -92,7 +101,7 @@
@Override
public PrintWriter getWriter() throws IOException
{
- if (_byteArrayWriter != null ) throw new IllegalStateException();
+ if (_byteArrayWriter != null) throw new IllegalStateException();
if (_writer == null)
{
_charArrayWriter = new CharArrayWriter(4096);
@@ -120,25 +129,30 @@
return null;
}
- static class WrappedServletOutputStream extends ServletOutputStream {
+ static class WrappedServletOutputStream extends ServletOutputStream
+ {
private ByteArrayOutputStream _byteArrayOutputStream;
- public WrappedServletOutputStream() {
+ public WrappedServletOutputStream()
+ {
_byteArrayOutputStream = new ByteArrayOutputStream(1024);
}
- public void write(int i) throws IOException {
- _byteArrayOutputStream.write(i);
+ public void write(int i) throws IOException
+ {
+ _byteArrayOutputStream.write(i);
}
- public byte[] toByteArray() {
+ public byte[] toByteArray()
+ {
return _byteArrayOutputStream.toByteArray();
}
- public void reset() {
+ public void reset()
+ {
_byteArrayOutputStream.reset();
}
-
+
}
}
Propchange: myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/application/jsp/ViewResponseWrapper.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision