当前位置:网站首页>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
边栏推荐
猜你喜欢

Open source RSS subscriber freshrss

新版Maixhub部署(V831与K210)

Animation curves are used every day. Can you make one by yourself? After reading this article, you will!

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

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

字节跳动技术面都过了,结果还是被刷了,问HR原因竟是。。。

如何用 Redis 实现分布式锁的?

Wet- a good choice for people with English difficulties - console translation

【leetcode天梯】链表 · 876 查找链表中间结点

成为比开发硬气的测试人,我都经历了什么?
随机推荐
[51nod1676 undirected graph isomorphism] undirected graph hash [easy to understand]
立创EDA——器件的创建01-电阻(二)
[hand tear STL] BitSet (bitmap), bloom filter
【测开方法论】测开平台pk心得-抉择
Redis configuration
Preliminary study on Tesseract OCR
在进行自动化测试,遇到验证码的问题,怎么办?
zigbee开发板(nxpzigbee开发)
Redis是什么?简述它的优缺点
Redis master-slave architecture lock failure problem (master-slave)
『SignalR』.NET使用 SignalR 进行实时通信初体验
Unity performance optimization direction
c sqlite ... ...
Is there any document for synchronizing from Oracle to ODPs?
Automatic assembly and fuse degradation of feign
dovecot 设置邮箱quota
动画曲线天天用,你能自己整一个吗?看完这篇你就会了!
虚拟内存与磁盘
【饭谈】如何设计好一款测试平台?
ZigBee development board (nxpzigbee Development)





