当前位置:网站首页>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
边栏推荐
- 面试高频考题解法——栈的压入弹出序列、有效的括号、逆波兰表达式求值
- JSP Taglib指令具有什么功能呢?
- QML package management
- Quick solution for infix to suffix and prefix expressions
- 双队列实现栈?双栈实现队列?
- Using the "stack" fast computing -- reverse polish expression
- Statement执行update语句
- OpenCV DNN blogFromImage()详解
- [Solution] Emqx startup under win10 reports Unable to load emulator DLL, node.db_role = EMQX_NODE__DB_ROLE = core
- Cash Ⅱ LeetCode_518_ change
猜你喜欢

【HCIP】BGP小型实验(联邦,优化)

GetHashCode与Equals

如何发现新的潜力项目?工具推荐

Quick solution for infix to suffix and prefix expressions

GIF making - very simple one-click animation tool

Win11如何获得最佳电源效率?

Detailed explanation of Zadig's self-testing and tuning environment technical solution for developers

22.支持向量机—高斯核函数

接地气讲解TCP协议和网络程序设计

【21天学习挑战赛】顺序查找和二分查找的小总结
随机推荐
LeetCode_518_零钱兑换Ⅱ
Win11如何获得最佳电源效率?
JSP out.write()方法具有什么功能呢?
一个有些意思的项目--文件夹对比工具(一)
06-SDRAM :SDRAM控制模块
单片机遥控开关系统设计(结构原理、电路、程序)
图解LeetCode——1161. 最大层内元素和(难度:中等)
JSP out.println()方法具有什么功能呢?
What is it like to trade for a living?
Play NFT summer: this collection of tools is worth collecting
ROS dynamic parameters
JSP request对象功能详解说明
Simpson's paradox
mysql8安装make报错如何解决
JSP内置对象out对象的功能简介说明
Unity—四元数、欧拉角API+坐标系统
Short video seo search optimization main content
短视频SEO搜索运营获客系统功能介绍
146. LRU 缓存
中缀转后缀、前缀表达式快速解决办法