com.mkaz.servlet.ServletBufferOut API Documentation

Class 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!");

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


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);


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


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.


public void flush()
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.