当前位置:网站首页>JSP built-in object out object function introduction
JSP built-in object out object function introduction
2022-08-02 00:18:00 【qq_25073223】
From:
Introduction to the function of the JSP built-in object out object
The following describes a brief description of the functions of the JSP built-in object out, as follows:
The function of the out object:output character stream to JSP page,It can convert dynamic content into html form and display it to the userNotes: 1. The out object is an instantiated object of the javax.servlet.jsp.JspWriter class. We can use the pageContext.getOut() method to get the out object 2.Using the <%=%> method to output is more convenient than out.println(), so we should try to use the <%=%> method to reduce the use of out objects
The method of JSP built-in object out
public abstract void clear() | Clear buffer contents, do not send data to client |
public abstract void clearBuffer() | Clear the buffer after sending the data to the client |
public abstarct void close() | Closes the output stream. |
public abstract void flush() | The data in the output buffer. |
public int getBufferSize() | Get the size of the buffer.The size of the buffer can be set with <%@ page buffer=size %> |
public abstract int getRemainning() | Get the size of the remaining buffer space |
public boolean isAutoFlush() | Get the AutoFlush value set with <%@ page is AutoFlush="true/false"%> |
public abstract void newLine() | Output a newline character, newline |
public abstract void print() | Display content of various data types |
public abstract void println() | Separate lines to display content of various data types |
Example
<%@ page language="Java" import="java.util.*" pageEncoding="GB2312"%>Test Page <%int all=out.getBufferSize();//Get the buffer sizeint remain=out.getRemaining();//Get the remaining buffer sizeint use=all-remain;//The size of the buffer usedout.println("Output information---use buffer size"+use);%>
边栏推荐
猜你喜欢
随机推荐
els strip deformation
632. 最小区间
众筹DAO“枯萎”的缩影:曾拍下《沙丘》未出版手稿的Spice DAO解散
基于注意力机制的多特征融合人脸活体检测
Detailed explanation of Zadig's self-testing and tuning environment technical solution for developers
A simple file transfer tools
基于超参数自动寻优的工控网络入侵检测
After reshipment tencent greetings to monitor if the corresponding service does not exist by sc. Exe command to add services
JSP如何使用request获取当前访问者的真实IP呢?
JSP 如何获取request对象中的路径信息呢?
Task execution control in Ansible
基于相关性变量筛选偏最小二乘回归的多维相关时间序列建模方法
background-image使用
利用“栈”快速计算——逆波兰表达式
好好活就是做有意义的事,有意义的事就是好好活
Deliver cloud-native microservices applications with Zadig
[Three sons] C language implements simple three sons
短视频seo搜索优化主要内容
bgp 聚合 反射器 联邦实验
C language Qixi is coming!It's time to show the romance of programmers!