当前位置:网站首页>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);%>
边栏推荐
猜你喜欢
随机推荐
Excel导入和导出
微软电脑管家V2.1公测版正式发布
Detailed explanation of Zadig's self-testing and tuning environment technical solution for developers
[Three sons] C language implements simple three sons
22.支持向量机—高斯核函数
具有通信时延的多自主体系统时变参考输入的平均一致性跟踪
【无标题】
bgp 聚合 反射器 联邦实验
How to find new potential projects?Tools recommended
磁盘与文件系统管理
一文概览最实用的 DeFi 工具
QML package management
零基础如何学习单片机,一位入门者的进阶路径,可参考
【解决】win10下emqx启动报错Unable to load emulator DLL、node.db_role = EMQX_NODE__DB_ROLE = core
SphereEx苗立尧:云原生架构下的Database Mesh研发实践
[Headline] Written test questions - minimum stack
DOM 事件及事件委托
Using the "stack" fast computing -- reverse polish expression
Arduino 基础语法
uni-app项目总结









