OutObject
The Out object is used to output information on a web Browser and to manage the output buffers on the application server. When you use an out object to output data, you can manipulate the data buffers to clear the remaining data in the buffer and make buffer space for other outputs. When the data output is complete, close the output stream in a timely manner.
1.outputting data to the client
An out object can output data of various data types, which are automatically converted to strings when the output is non-string. out provides print () and println () Two kinds of output information to the page.
Print () method
Using the print () method to output information to the client is equivalent to using a JSP expression
Example:
<%
Out.print ("Zhangsan");
%>
<%
= "Zhansan";
%>
println () method
A newline character is more than the print () method.
When you use the println () method to output to a page, you cannot really see the effect of text wrapping. If you want to see the effect of a newline, include the contents of the output in HTML tags <pre> .
2. Manage the appropriate buffers
an Out object is a more important feature of managing the contents of a buffer.
The Clear () method of the Out object clears the contents of the buffer, similar to resetting the response stream, and generates a IOException exception if the response has already been committed .
The Clearbuffer () method of the Out object is used to clear the contents of the current buffer and can be accessed even if the content has been submitted to the client.
methods for managing buffers for out objects
Clear (): clears the contents of the buffer
Clearbuffer (): clears the contents of the current buffer
Flush (): Refresh Stream
Isautoflush (): detects whether the current buffer is full when it is automatically emptied or throws an exception
GetBufferSize (): Gets the size of the buffer
JSP detailed article--out