| Java FAQ | ||
| JSP FAQ | ||
| Servlet FAQ | ||
XyzWs JSP FAQ:
What is the out implicit object?
Printer-friendly version |
Mail this to a friend
|
Advertisement
|
||||||||||||||||||||
What is the
|
| Method | Description |
|---|---|
| clear | Clears the output buffer without writing the contents to the client. This method throws an exception if the buffer was flushed. |
| clearBuffer | Clears the output buffer without writing the contents to the client. |
| flush | Flushes the buffer by writing the contents to the client. When passing huge data to the client from your JSP/Servlet, user may need to wait till the ServletOutputStream or JSPWriter flushes the data. This happens generally whenever you have a number of gifs per page and you want to pass it to the client. The better approach is to flush the data partly using flush() method rather than flushing whole data at a time. |
| getBufferSize | Returns the size of the buffer in bytes. Returns 0 if the output is not buffered. |
| getRemaining | Returns the number of empty bytes in the buffer. |
| isAutoFlush | Returns true if the output buffer is flushed automatically. |
| newLine | Writes a newline character to the output. |
| Writes a value to the output, with no newline character. | |
| println | Writes a value to the output, including a newline character. The method internally calls print() method and there is no need for a new line separation when generating html pages. So a small overhead of calling one more method is reduced if you use print() method directly. |
JSP page authors are prohibited from writing directly to either the PrintWriter or OutputStream associated with the ServletResponse.(See JavaServer Pages Specification Version 1.2): For example, you can not use the following code in you JSP otherwise you will get compiling error:
<% response.getWriter().println("Hello!"); %>