当前位置:网站首页>JSP novice
JSP novice
2022-07-25 22:00:00 【Hua Weiyun】
Catalog
jsp The head of the page Instructions
JSP brief introduction
jsp The full name is java server pages .java The server page of .
jsp The main function of is to replace Servlet Program returns html Page data .
because Servlet Program returns html Page data is a very cumbersome thing , Not conducive to development and maintenance .
jsp The creation of
jsp How to access the
jsp Page and html equally , It's all stored in web Under the table of contents . Access is also related to html The page is the same .
Such as :web A file in a directory
a.html page :http://ip:port/ Project path /a.html
b.jsp page :http://ip:port/ Project path /b.jsp
jsp The essence of
jsp The essence of servlet Program
When we first visited the server ,tomcat Will be able to jsp Translate the page into a java Source file , And compile it into .class The bytecode program of
Bytecode file is the corresponding java Source file , Open the source file to find
b_jsp This class inherits HttpJspBase class , We go through idea Find out HttpJspBase Class directly inherits HttpServlet class , So ,jsp Translated java Class indirectly inherits HttpServlet class , So ,jsp In essence Servlet Program
Observe the translation Servlet The source code can find , The lower layer also uses the output stream to put html The page is returned to the client .
jsp The head of the page Instructions
jsp Of page Instructions can be modified jsp Some important properties of the page , Or act .
Common properties :
language attribute Express jsp What language documents are translated , For the time being, it can only support Java.
contentType attribute Express jsp What is the data type returned , In the source code response.setContentType() Parameter values
pageEncoding attribute At present jsp The character set of the page file itself .
import attribute Follow java The same as in the source code is used to import packages , Guide class . Such as :
autoFlush attribute Set when out When the output stream buffer is full , Whether to automatically refresh the buffer , Default true.
buffer attribute Set up out Size of buffer , The default is 8kb
When we set not to automatically refresh the buffer , And when the buffer setting is relatively small, it will happen jsp overflow , If auto refresh is set, there will be no overflow .( Buffer settings 8kb Is the best comprehensive )
errorPage attribute Set when jsp An error occurred while the page was running , Automatically jump to the wrong page path
errorPage Indicates the path to automatically jump after an error , This path usually starts with a diagonal bar , He said the request address was http://ip:port/ Project path /, Map to... In the code web Catalog
b.jsp The page is as follows :
isErrorPage attribute Set up current jsp Whether the page · Error message page , The default is false, If it is true You can get exception information .
session attribute Set access current jsp page , Will it create HttpSession object , The default is true.
extends attribute Set up jsp Translated java Class inherits by default
边栏推荐
- [fan Tan] in detail: lower control, upward management, upward drawing cake.
- Uninstall NPM and install NPM_ Use 'NPM uninstall' to uninstall the NPM package 'recommended collection'
- 【leetcode天梯】链表 · 876 查找链表中间结点
- c sqlite ... ...
- 突破性思维在测试工作中的应用
- How to solve the problem of using the download Plug-in for export?
- 2 lines of code to generate a solid desktop background
- C language left value and right value description [easy to understand]
- 字节跳动技术面都过了,结果还是被刷了,问HR原因竟是。。。
- 信息安全建设原则指导
猜你喜欢

ansible+Crontab批部署巡检

The second short contact of gamecloud 1608

在腾讯干软件测试3年,7月无情被辞,想给划水的兄弟提个醒...

少儿编程 电子学会图形化编程等级考试Scratch一级真题解析(判断题)2022年6月

New maixhub deployment (v831 and k210)

Open source RSS subscriber freshrss
![[go basics 02] the first procedure](/img/af/f32762a828f384bf6aa063ebf959aa.png)
[go basics 02] the first procedure

Bitcoin.com:USDD代表了真正去中心化稳定币

Special class design

After three years of software testing at Tencent, I was ruthlessly dismissed in July, trying to wake up my brother who was paddling
随机推荐
After 2 years of functional testing, I feel like I can't do anything. Where should I go in 2022?
I/o case practice
The testing work is not valued. Have you changed your position?
Configuration and use of multithreading
[51nod1676 undirected graph isomorphism] undirected graph hash [easy to understand]
Wet- a good choice for people with English difficulties - console translation
GPON introduction and Huawei OLT gateway registration and configuration process
2年功能测试,却感觉自己什么都不会,2022我该何去何从?
Excuse me, how to deal with repeated consumption of MySQL data
卸载npm和安装npm_使用`npm uninstall`卸载npm软件包「建议收藏」
核电站在席卷欧洲的热浪中努力保持安全工作
C language: random generated number + bubble sort
Open source RSS subscriber freshrss
Lichuang EDA -- creation of devices 01 resistance (II)
【汇编语言01】基础知识
Pyg tutorial (8): calculate a more efficient sparse matrix form
The reisson distributed lock renewal failed due to network reasons, resulting in the automatic release of the lock when the business is still executing but the lock is not renewed.
Jmeter---设置代理录制请求
Why do independent sellers like to do e-mail marketing? The original conversion rate can be improved so much!
如何快速搭建图片服务器[通俗易懂]





