ninja.utils
Class ResponseStreamsServlet

java.lang.Object
  extended by ninja.utils.ResponseStreamsServlet
All Implemented Interfaces:
ResponseStreams

public class ResponseStreamsServlet
extends Object
implements ResponseStreams

Make sure to only write to either the OutputStream OR the Writer...

Author:
rbauer

Constructor Summary
ResponseStreamsServlet()
           
 
Method Summary
 OutputStream getOutputStream()
          Get the output stream to write the response.
 Writer getWriter()
          Get the writer to write the response.
 void init(javax.servlet.http.HttpServletResponse httpServletResponse)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseStreamsServlet

public ResponseStreamsServlet()
Method Detail

init

public void init(javax.servlet.http.HttpServletResponse httpServletResponse)

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Get the output stream to write the response. Must not be used if getWriter has been called.

Specified by:
getOutputStream in interface ResponseStreams
Returns:
The output stream
Throws:
IOException

getWriter

public Writer getWriter()
                 throws IOException
Get the writer to write the response. Must not be used if getOutputStream has been called.

Specified by:
getWriter in interface ResponseStreams
Returns:
The writer
Throws:
IOException


Copyright © 2012. All Rights Reserved.