What is the out implicit object in JSP?


The out implicit object is an instance of a javax.servlet.jsp.JspWriter object and is used to send content in a response.

The initial JspWriter object is instantiated differently depending on whether the page is buffered or not. Buffering can be easily turned off by using the buffered = 'false' attribute of the page directive.

The JspWriter object contains most of the same methods as the java.io.PrintWriter class. However, JspWriter has some additional methods designed to deal with buffering. Unlike the PrintWriter object, JspWriter throws IOExceptions.

Following table lists out the important methods that we will use to write boolean char, int, double, object, String, etc.

Sr.No.Method & Description
1out.print(dataType dt)
Print a data type value
2out.println(dataType dt)
Print a data type value then terminate the line with new line character.
3out.flush()
Flush the stream.

Updated on: 30-Jul-2019

393 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements