com.mkaz.servlet.ServletBufferOut API Documentation


com.mkaz.servlet
Class ServletBufferOut

java.lang.Object
  |
  +--com.mkaz.servlet.ServletBufferOut

public class ServletBufferOut
extends java.lang.Object

com.mkaz.ServletBufferOut is a java servlet library which provides simplified buffered output for servlets removing all of the out.println and StringBuffer hassles. .

Example Usage:


      ServletBufferOut bout = new ServletBufferOut(response);
      bout.append("This is a line!");
      bout.flush();
 
 


Constructor Summary
ServletBufferOut(javax.servlet.http.HttpServletResponse resp)
          Main Constructor.
ServletBufferOut(javax.servlet.http.HttpServletResponse resp, java.lang.String ctype)
          Constructor specifying content type.
 
Method Summary
 void append(java.lang.String str)
          Append string to the Buffered Output.
 void flush()
          Flushes the Buffered Output to the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletBufferOut

public ServletBufferOut(javax.servlet.http.HttpServletResponse resp)
Main Constructor. You need to create a servletBufferOut object, by passing it the HttpServletResponse. Creates HTML as the default content-type.

Example: servletBufferOut bout = new servletBufferOut(response);


ServletBufferOut

public ServletBufferOut(javax.servlet.http.HttpServletResponse resp,
                        java.lang.String ctype)
Constructor specifying content type. You need to create a servletBufferOut object, by passing it the HttpServletResponse. Used to specifiy a different content type.

Example: servletBufferOut bout = new servletBufferOut(response, "text/plain");

Method Detail

append

public void append(java.lang.String str)
Append string to the Buffered Output. Use this method to put together your output (web page) created by the servlet.

flush

public void flush()
           throws java.io.IOException
Flushes the Buffered Output to the screen. This method should be called when the page is ready to be "printed" to the screen. It sets the content type, content length, and writes out the buffer to the screen.