当前位置:网站首页>How does JSP use the page command to make the JSP file support Chinese encoding?
How does JSP use the page command to make the JSP file support Chinese encoding?
2022-08-02 00:18:00 【qq_25073223】
From:
jsp introduction:
The full name of JSP is Java Server Pages, which is a dynamic web page technology. JSP is actually a file formed by inserting java code and JSP tags into html, and the file name ends with .jsp.In fact, JSP is a servlet.
Writing html in servlet is more painful, and writing JSP is like writing html, but compared with html, html can only provide users with static data, that is, static pages, and Jsp technology allows java to be nested in pagescode to provide users with dynamic data to form dynamic pages.It should be noted that it is best to only write java code for dynamic output in JSP.
JSP workflow
Converting JSP files to .java files and compiling them to .class filesThe process is all completed by tomcat. There is a translation engine inside tomcat. When the JSP page is accessed for the first time, the translation engine converts it into a .java file and compiles a .class file.Then run the class file again.
The html code in JSP will be translated into out.write() in servlet
The following describes the method sharing of JSP files supporting Chinese encoding, as shown below:
Implementation ideas: 1. Use the pageEncoding attribute to set the encoding method in the page instruction (using the JSP file itself to support Chinese) 2. Set the charset value in the contentType,Use the client to support ChineseExample
<%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>test pageEncoding Set JSP Chinese encoding, pageEncoding property test
边栏推荐
- 基于编码策略的电网假数据注入攻击检测
- Task execution control in Ansible
- Excel表格数据导入MySQL数据库
- IP Core: FIFO
- After an incomplete recovery, the control file has been created or restored, the database must be opened with RESETLOGS, interpreting RESETLOGS.
- QML package management
- DVWA靶场环境搭建
- How to solve the error when mysql8 installs make
- LeetCode_279_完全平方数
- ROS 动态参数
猜你喜欢
随机推荐
如何优雅的消除系统重复代码
DOM 事件及事件委托
【21天学习挑战赛】顺序查找和二分查找的小总结
TCL:在Quartus中使用tcl脚本语言进行管脚约束
Quick solution for infix to suffix and prefix expressions
[头条]笔试题——最小栈
控制电机的几种控制电路原理图
一文概览最实用的 DeFi 工具
How does JSP use request to get the real IP of the current visitor?
不就是个TCC分布式事务,有那么难吗?
单片机遥控开关系统设计(结构原理、电路、程序)
重装腾讯云云监控后如果对应服务不存在可通过sc.exe命令添加服务
协作乐高 All In One:DAO工具大全
2022/08/01 学习笔记 (day21) 泛型和枚举
C语言七夕来袭!是时候展现专属于程序员的浪漫了!
Collection of NFT tools
TCL: Pin Constraints Using the tcl Scripting Language in Quartus
使用 Zadig 交付云原生微服务应用
08-SDRAM:汇总
Graphical LeetCode - 1161. Maximum Sum of In-Layer Elements (Difficulty: Moderate)








