An out object is an output stream that transmits the results generated by the JSP page to the web browser, and all information that the JSP page sends to the web browser is transmitted through the out object.  All information includes both script and non-script elements such as HTML and general text. Here are some examples of the out object.

 

You can check the size and the use of Buffer. 

outEx.jsp

<%@ page contentType="text/html;charset=euc-kr" buffer="5kb"%>

<%
	int totalBuffer = out.getBufferSize();
	int remainBuffer = out.getRemaining();
	int useBuffer = totalBuffer - remainBuffer;
%>

<h1>Out Example</h1>
<b>Buffer status on current page</b><p>

Total Buffer Size : <%=totalBuffer%>byte<p>
Current Use of Buffer : <%=useBuffer%>byte<p>
Remain Buffer Size : <%=remainBuffer%>byte<p>

useOut.jsp

<%@ page contentType = "text/html; charset=euc-kr" %>

<html>
<head><title>out Object2</title></head>
<body>

<%
    out.println("What's up?");
%>
<br>

This is the result of
<%
    out.println("the basic out object.");
%>

</body>
</html>

 

 

println in JSP does not change the line.

To change the line, you need to put the <br> tag like this :

<%@ page contentType = "text/html; charset=euc-kr" %>

<html>
<head><title>out Object2</title></head>
<body>

<%
    out.println("What's up?<br>");
    out.println("Let's change the line.<br>");
%>
<br>

This is the result of
<%
    out.println("<br>the basic out object.");
%>

</body>
</html>

<br> tags are used.

 

+ Recent posts