当前位置:网站首页>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
边栏推荐
- [test development methodology] experience of test development platform PK - choice
- The automation testing post spent 20K recruiting, but in the end, there was no suitable one. Both fresh students are better than them
- 【饭谈】那些看似为公司着想,实际却让人无法理解的事(二:面试时的软素质“眼缘”)
- C语言左值和右值说明[通俗易懂]
- JMeter websocket interface test
- What should I do if I encounter the problem of verification code during automatic testing?
- Sofa weekly | open source person - Niu Xuewei, QA this week, contributor this week
- What are the application characteristics of NTU general database gbase Bi?
- 五种分配方式是否会产生内部碎片、外部碎片
- JMeter websocket接口测试
猜你喜欢

虚拟内存与磁盘

What should I do if I encounter the problem of verification code during automatic testing?

Guiding principles of information security construction

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

【GO基础02】第一个程序
![[dinner talk] those things that seem to be for the sake of the company but are actually incomprehensible (2: soft quality](/img/11/42c4674d23ee93850fb3d2de0d0932.png)
[dinner talk] those things that seem to be for the sake of the company but are actually incomprehensible (2: soft quality "eye edge" during interview)

【饭谈】那些看似为公司着想,实际却让人无法理解的事(二:面试时的软素质“眼缘”)

2年功能测试,却感觉自己什么都不会,2022我该何去何从?

新版Maixhub部署(V831与K210)

Idea resolves the prompt of profile properties disappear
随机推荐
JMeter websocket接口测试
【leetcode天梯】链表 · 876 查找链表中间结点
At present, flynk CDC does not support mysql5.5. If you change the source code and release this restriction, there will be a lot of data problems?
2022最新软件测试八股文,能不能拿心仪Offer就看你背得怎样了
golang : MVC之models
The automation testing post spent 20K recruiting, but in the end, there was no suitable one. Both fresh students are better than them
[51nod1676 undirected graph isomorphism] undirected graph hash [easy to understand]
[redis underlying parsing] linked list type
Why do independent sellers like to do e-mail marketing? The original conversion rate can be improved so much!
Redis基础2(笔记)
YUV420 yuv420sp image format "recommended collection"
[go basics 02] the first procedure
YUV420 YUV420sp 图像格式「建议收藏」
Share | intelligent fire emergency management platform solution (PDF attached)
I/O案例实操
成为比开发硬气的测试人,我都经历了什么?
新版Maixhub部署(V831与K210)
Three ways to allocate disk space
[51Nod1676 无向图同构]无向图哈希[通俗易懂]
Tesseract OCR初探





