当前位置:网站首页>Difference between JSP out.print() and out.write() methods
Difference between JSP out.print() and out.write() methods
2022-08-02 00:18:00 【qq_25073223】
From:
JSP outDifference between .print() and out.write() methods
The following describes the difference between the out.print() and out.write() methods, as follows:
Introduction to out.print() and out.write() methods
out.print() and out.write() methods in JSPAll belong to the methods of the abstract subclass JspWriter of the abstract class Writer;The out.print() method belongs to the method in the abstract subclass JspWriter,And out.write() is a method of the parent class Writer.-------------------------------------------------out.print(): The method in the JspWriter class is calledout.writer(): calls the method in its parent Writer class
The difference between the two methods:1. The print method is a subclass of JspWriter, and write is a method defined in the Writer class. 2. The overloaded print method can convert various types of data into strings.The form of output, and the overloaded write method can only output character-related data such as characters, character arrays, and strings. The JspWriter type out object can output strings using both the print method and the write method. 3. If the value of the string objectWhen it is null, the print method will output a string with the content "null" and the write method will throw a NullPointerException exception Example
Output numbers
<% out.print(98); %>
<% out.write(98); %>-----Run the above code, it will output different information---98-----------------b
边栏推荐
- security跨域配置
- JSP如何使用page指令让JSP文件支持中文编码呢?
- 【Leetcode】470. Implement Rand10() Using Rand7()
- IP Core: FIFO
- OpenCV DNN blogFromImage() detailed explanation
- 当奈飞的NFT忘记了Web2的业务安全
- An interesting project--Folder comparison tool (1)
- Axure教程-新手入门基础(小白强烈推荐!!!)
- [Three sons] C language implements simple three sons
- 一篇永久摆脱Mysql时区错误问题,idea数据库可视化插件配置
猜你喜欢
随机推荐
不了解SynchronousQueue?那ArrayBlockingQueue和LinkedBlockingQueue不会也不知道吧?
图解LeetCode——1161. 最大层内元素和(难度:中等)
ROS 动态参数
06-SDRAM :SDRAM控制模块
DOM 基础操作
SphereEx苗立尧:云原生架构下的Database Mesh研发实践
Win10安装DBeaver连接MySQL8、导入和导出数据库详细教程
GIF making - very simple one-click animation tool
Ansible中的任务执行控制
基于编码策略的电网假数据注入攻击检测
【解决】win10下emqx启动报错Unable to load emulator DLL、node.db_role = EMQX_NODE__DB_ROLE = core
面试必问的HashCode技术内幕
基于相关性变量筛选偏最小二乘回归的多维相关时间序列建模方法
C语言七夕来袭!是时候展现专属于程序员的浪漫了!
一文概览最实用的 DeFi 工具
SphereEx Miao Liyao: Database Mesh R&D Practice under Cloud Native Architecture
Async/await principle and execution sequence analysis
QML package management
面试高频考题解法——栈的压入弹出序列、有效的括号、逆波兰表达式求值
众筹DAO“枯萎”的缩影:曾拍下《沙丘》未出版手稿的Spice DAO解散









