当前位置:网站首页>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
边栏推荐
- Configuration and use of multithreading
- Guys, how can Flink SQL submit tasks in per job mode?
- JS timer and swiper plug-in
- Redis基础2(笔记)
- c sqlite ... ...
- Redis 使用详解
- 文件无法保存(文件夹已损坏无法读取怎么办)
- 8000 word super detailed custom structure type
- 【测开方法论】测开平台pk心得-抉择
- Bitcoin.com:usdd represents a truly decentralized stable currency
猜你喜欢

Sofa weekly | open source person - Niu Xuewei, QA this week, contributor this week

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

五种分配方式是否会产生内部碎片、外部碎片

分享|智慧消防应急管理平台解决方案(附PDF)

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

关于接口测试你想知道的都在这儿了

自动化测试岗花20K招人,到最后居然没一个合适的,招两个应届生都比他们强吧

突破性思维在测试工作中的应用

Basic knowledge in the project

磁盘空间的三种分配方式
随机推荐
JSP初识
Redis为何选择单线程?
6-17漏洞利用-反序列化远程命令执行漏洞
[MAIXPY]kpu: load error:2005, ERR_READ_FILE: read file failed问题解决
Ability to choose
In Oracle 19C version, logminer package continuous_ The outdated function of mine leads to CDC failure
Shopify sellers: share some tips for social media marketing!
Redis是什么?简述它的优缺点
2022 love analysis ― bank digitalization practice report
golang : MVC之models
在腾讯干软件测试3年,7月无情被辞,想给划水的兄弟提个醒...
C language: random generated number + bubble sort
如何用 Redis 实现分布式锁的?
[redis underlying parsing] string type
JMeter websocket接口测试
Configuration and use of multithreading
Excuse me, how to deal with repeated consumption of MySQL data
【饭谈】那些看似为公司着想,实际却让人无法理解的事(二:面试时的软素质“眼缘”)
I/O案例实操
[fan Tan] after the arrival of Web3.0, where should testers go? (ten predictions and suggestions)





