1. First introduce the difference between the write () and print () methods:
(1), write (): Supports output character type data only, character, character array, string, etc.
(2), print (): The data of various types (including object) can be converted into bytes byte form by default encoding, which is output by the write (int c) method
2, introduce the difference between response.getwriter () and out:
(1), out and Response.getwriter classes are not the same, one is JspWriter, the other is java.io.PrintWriter.
(2), the principle of implementation is different: JspWriter is equivalent to a printwriter with a cache function, it does not directly output data to the page, but the data is flushed to the response buffer and then output, Response.getwriter Direct output data (Response.print ()), so (Out.print) can only be output thereafter.
(3), out for the JSP's built-in object, refresh the JSP page, automatically initialize the Out object, so the use of the Out object is needed to refresh the page, and the Response.getwriter () response information through the Out object output to the Web page, when the response is closed automatically when the end of the Regardless of the JSP page, there is no need to refresh the page.
for a chestnut : When we call Response.getwriter () This object also obtains the brush of the Web page, then you can use this brush to draw anything you want to display on the Web page.
(4), Out of the print () method and the println () method will generate IOException when the buffer overflows and there is no automatic refresh, while the Response.getwrite () method's print and println are suppressed IO Exception exception, there will be no IO exception exception.
3, about the output expression <%=%>
(1), this is also about the output, and this expression of output compared to the above two, the only advantage is that the code can be divided into a clearer, but it is more troublesome to write.
Write () and print () also have <%=%> subtle differences