当前位置:网站首页>JSP technology
JSP technology
2022-06-12 07:55:00 【Watermelon 77】
JSP
What is? jsp: It is built on servlet Dynamic web page development technology based on standard .
jsp = java + html + jsp Something about yourself . To write jsp After the document jsp Generate java file , Translate it into class file , There is tomcat Server's work Directory .
JSP notes :
1.html notes : It exists everywhere .
2.java notes : A single , Multiple lines , Documentation Comments . It exists jsp page , Also exist java In the document , Corresponding generated html The file disappears .
3. jsp notes : <%-- jsp notes –>. There is only jsp page , Generating the corresponding java When you file , It disappears automatically .
page Instructions
page The purpose of the command is to set and jsp Page related information , For example, setting up jsp Page code ,jsp The default language of the page, etc .
Basic grammar :<%@ page attribute =“ Property value ” attribute =“ Property value ” attribute =“ Property value ” %>
stay jsp Pages usually need to display information from other pages , So you can go through this include Command to include other pages .
Basic grammar :<%@ include file=“ Of contained files url” %>
Create two jsp page : date.jsp page ,include.jsp page .
Use jsp Of include The inclusion of an instruction implementation , Also known as static inclusion , The characteristics of static inclusion :
1. Put the content of multiple pages , Merge output , For example date.jsp and include.jsp Content merge output .
2. Multiple pages will generate one java file , After compiling , Corresponding to one class file .
Implicit objects
Implicit objects are jsp Inside the page ,jsp Provides some objects , You don't have to create it yourself , Objects that can be used directly .
jsp Nine common implicit objects :
1.request: HttpServletRequest, Request object , It's also a domain object , Scope a request
2.response:HttpServletResponse, The response object
3.session: HttpSession , Conversation object , It's also a domain object , Scope a conversation
4.application:ServletContext, Context object , It's also a domain object , The whole project
5.config:ServletConfig, Configuration object
out:JspWriter, Actually sum PrintWriter It's about the same .
page:Object , On behalf of the current jsp Page objects for
pageContext:PageContext ,jsp Containers
6.exception:Throwable, Exception object , Used to capture exception information . Be careful : Only current jsp Page has isErrorPage="true" When this property , Can be used exception object .
7.out object :out Object to output content to the web page , And finally through reponse Buffer for output .
8.pageContext object : The first function : Get the other eight implicit objects
9.exception object : It's used to capture exception information .
jsp:include Action elements :
Dynamic inclusion
Dynamic inclusion : Put the content of other resources page , Merge to the current page to be included , Last output .
Basic grammar :<jsp:include page=“ Of the included page url” flush=“true perhaps false”>jsp:include
Dynamic inclusion features : The content of multiple pages is merged and output , Multiple jsp Page generation multiple java file , Compile into multiple class file
Static inclusion features : The content of multiple pages is merged and output , Multiple jsp The page eventually generates a java file , Compile one class file .
Request forwarding
Its function is to forward requests , The effect is equivalent to RequestDispathcer Object's forward Method .
Basic grammar :<jsp:forward page=“ Forward page's url Address ”></jsp:forward>
Forward page's url Address : You don't need to carry the project name , Because forwarding is an internal behavior of the server .
边栏推荐
- FPGA based communication system receiver [packet detection] development document
- Voice assistant -- Qu -- query error correction and rewriting
- Leverage contextual information
- Meter Reading Instrument(MRI) Remote Terminal Unit electric gas water
- Fundamentals of Mathematics - Taylor Theorem
- Chapter 2 - cyber threats and attacks
- 电脑连接上WiFi但是上不了网
- 石油储运生产 2D 可视化,组态应用赋能工业智慧发展
- Voice assistant - potential skills and uncalled call technique mining
- Topic 1 Single_Cell_analysis(3)
猜你喜欢

Topic 1 Single_Cell_analysis(3)

Leverage contextual information

Process terminated

Mathematical knowledge - derivation - Basic derivation knowledge

Classic paper review: palette based photo retrieval

Pytorch profiler with tensorboard.

Mathematical knowledge - matrix - matrix / vector derivation
![[redistemplate method details]](/img/ef/66d8e3fe998d9a788170016495cb10.png)
[redistemplate method details]

Voice assistant - DM - distribution and sorting

Voice assistant -- Architecture and design of Instruction Assistant
随机推荐
Utilize user behavior data
How to standardize the creation of a pytorch project
Literature reading: raise a child in large language model: rewards effective and generalizable fine tuning
Voice assistant -- Qu -- semantic role annotation and its application
Multithread decompression of tar
Solve the problem of uploading sftporg apache. commons. net. MalformedServerReplyException: Could not parse respon
2021.10.31-11.1 scientific research log
Voice assistant -- vertical class perpetual motion machine -- automated iteration framework
Topic 1 Single_Cell_analysis(3)
The R language catools package divides the data, the scale function scales the data, the KNN function of the class package constructs a k-nearest neighbor classifier, and compares the model accuracy u
数值计算方法 Chapter6. 解线性方程组的迭代法
Leetcode notes: Weekly contest 296
Getting started with Jetson nano Series IV: common skills of NVIDIA Jetson nano
『Three.js』辅助坐标轴
Visual studio code batch comment and uncomment
Symfony 2: multiple and dynamic database connections
数值计算方法 Chapter5. 解线性方程组的直接法
2021.10.27-28 scientific research log
Rnorm function of R language generates positive distribution data, calculates descriptive statistical summary information of vector data using sum function of epidisplay package, and visualizes ordere
Mathematical knowledge - matrix - matrix / vector derivation