当前位置:网站首页>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 objectsThe 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);%>
边栏推荐
猜你喜欢
随机推荐
回顾历史5次经济衰退时期:这一次可能会有何不同?
SphereEx苗立尧:云原生架构下的Database Mesh研发实践
22. The support vector machine (SVM), gaussian kernel function
Ansible中的任务执行控制
els 方块变形判断。
async/await 原理及执行顺序分析
电机原理动图合集
零基础如何学习单片机,一位入门者的进阶路径,可参考
Graphical LeetCode - 1161. Maximum Sum of In-Layer Elements (Difficulty: Moderate)
众筹DAO“枯萎”的缩影:曾拍下《沙丘》未出版手稿的Spice DAO解散
Unity—四元数、欧拉角API+坐标系统
一文概览最实用的 DeFi 工具
PHP从txt文件中读取数据的方法
security CSRF漏洞保护
IO流基础
2022/08/01 学习笔记 (day21) 泛型和枚举
06-SDRAM :SDRAM控制模块
扑克牌问题
C语言七夕来袭!是时候展现专属于程序员的浪漫了!
如何优雅的消除系统重复代码



![[Headline] Written test questions - minimum stack](/img/67/08f2be8afc780e3848371a1b5e04db.png)





