当前位置:网站首页>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
边栏推荐
- Uninstall NPM and install NPM_ Use 'NPM uninstall' to uninstall the NPM package 'recommended collection'
- Lichuang EDA -- creation of devices 01 resistance (II)
- 【饭谈】软件测试薪资层次和分段(修仙)
- c sqlite ... ...
- The automation testing post spent 20K recruiting, but in the end, there was no suitable one. Both fresh students are better than them
- 核电站在席卷欧洲的热浪中努力保持安全工作
- c sqlite ... ...
- C language: random generated number + bubble sort
- GPON介绍及华为OLT网关注册配置流程
- 信息安全建设原则指导
猜你喜欢

动画曲线天天用,你能自己整一个吗?看完这篇你就会了!

开源的RSS订阅器FreshRSS

Basic knowledge in the project

Idea resolves the prompt of profile properties disappear

The technical aspects of ByteDance are all over, but the result is still brushed. Ask HR why...

Create EDA - why should I learn EDA

【leetcode天梯】链表 · 021 合并两个有序链表

6-17漏洞利用-反序列化远程命令执行漏洞
![[MAIXPY]kpu: load error:2005, ERR_READ_FILE: read file failed问题解决](/img/0b/da67b5a361a2cdfaf81568d34cf5f7.png)
[MAIXPY]kpu: load error:2005, ERR_READ_FILE: read file failed问题解决

After three years of software testing at Tencent, I was ruthlessly dismissed in July, trying to wake up my brother who was paddling
随机推荐
C语言左值和右值说明[通俗易懂]
6-18漏洞利用-后门连接
EL表达式改进JSP
Redis基础2(笔记)
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.
[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)
2022 the latest software tests eight part essay. Whether you can offer depends on how you recite it
LeetCode_ 93_ Restore IP address
Children's programming electronic society graphical programming level examination scratch level 1 real problem analysis (judgment question) June 2022
Redis configuration
别投了,软件测试岗位饱和了...
GPON introduction and Huawei OLT gateway registration and configuration process
【饭谈】Web3.0到来后,测试人员该何去何从?(十条预言和建议)
[assembly language 01] basic knowledge
新版Maixhub部署(V831与K210)
Wet- a good choice for people with English difficulties - console translation
Redis master-slave architecture lock failure problem (master-slave)
Create EDA - why should I learn EDA
在腾讯干软件测试3年,7月无情被辞,想给划水的兄弟提个醒...
Open source RSS subscriber freshrss





