当前位置:网站首页>Summary of web development technology knowledge
Summary of web development technology knowledge
2022-06-21 14:12:00 【Enthusiastic little fans】
One 、 Basic concepts
1)jsp:Java Server Page--web Server design criteria , Dynamic website
2)web:world wide web abbreviation www web
3)url: Uniform resource identifiers ( website )= Name of agreement + Host name / domain name /IP Address + file name ( Inclusion path )
http: Hypertext transfer protocol
https And http The difference between :https It's about security http passageway , yes http Security version , stay http Add socket under SSL layer , Encrypt the transmission page .
Two 、JSP
1)JSP And Servlet

JSP The designed dynamic web page mainly realizes the display function ,JSP It's a server-side scripting language , To reduce the Servlet The difficulty of using . It provides Servlet All the functions that can be realized ,JSP Is translated into Servlet Before compiling and running .
Servlet The designed dynamic web page mainly realizes the control function .
2)JSP Command elements
<%@ Instruction names attribute 1=" Property value 1" attribute 2=" Property value 2" … %>
page Instructions : Define the global properties of the entire page

Design JSP Program (ch03_3_page.jsp), Show ( The server ) The current time of the system .
Because you want to use a date class object , therefore , Must from page Command import java.util.Date class , meanwhile , Because Chinese characters are used in the page , You need to use a code that supports Chinese characters , Here the “UTF-8” code , therefore , need page Instruction assignment
contentType="text/html"
pageEncoding="UTF-8"
import="java.util.Date"
include Instructions : Used to include a file
taglib Instructions : Reference third-party tag libraries
3)JSP Action elements
The action element belongs to the server side JSP Elements , It is used to mark and control JSP The behavior of the engine
JSP The first phase of the page lifecycle is the transformation phase , In this phase JSP The page is converted to contain the corresponding Servlet Of Java file , The container will... According to the following rules JSP The elements in are converted to Servlet Code :
There are some Instructions During the transition phase Java Code , for example page The directive import Attributes generate Servlet Class import sentence . Some instructions simply tell the container about the overall nature of the page , for example page The directive contentType Property specifies the content type of the response ,session Property specifies whether the page participates in HTTP conversation .
be-all JSP Statement , All become generated Servlet Part of class , They are copied as is . The variables declared in this way become instance variables , Declared methods become instance methods .
all JSP Script , All become _jspService() Part of the method , They are also copied as is . So the variables declared in the script become _jspService() Method's local variables , You cannot declare a method in a script , Because in Java A method cannot be defined in a method in a language !!
be-all JSP expression , All become _jspService() Part of the method , The value of the expression uses out.print() Statement output .
be-all JSP action Are replaced by vendor specific classes .
all Expression language EL Use after calculation out.write() Statement output .
All template text , All become _jspService() Part of the method , Template content usage out.write() Statement output .
be-all JSP notes All ignored
stay JSP The conversion phase of the page , The container in _jspService() Method to declare and initialize some variables , Can be in JSP These variables are used directly in page scripts or expressions . These variables are objects created by the container , So it's also called Implicit or built-in objects .
matters needing attention :
because JSP The variables and methods defined in the page declaration become generated Servlet Class members , So the order in which they appear on the page doesn't matter .
Because the script will be converted to Servlet Of _jspService() Part of the method , Therefore, the variables declared in the script become local variables of the method , So the order in which they appear is very important . The following code will not be compiled
<% String s=s1+s2; %> //s2 Used before a declaration
<%! String s1="hello"; %>
<% String s2="hello"; %>
<% out.print(s); %>
stay Java In language , Instance variables are automatically initialized to default values , Local variables must be explicitly assigned before they are used . So in JSP The variables declared in the declaration are initialized to the default value , The variables declared in the script must be explicitly initialized before use .
It should be noted that , Instance variables are instantiated in the container Servlet Is created and initialized only once , So in JSP Variables declared in the declaration keep their values throughout multiple requests , Local variables are created and destroyed for each request , Therefore, variables declared in the script do not maintain their values in multiple requests , But in JSP Every time the container calls _jspService() Method is reinitialized
边栏推荐
- How to unit test non pure functions -- unittest
- Postman testing websocket interface
- Redis learning (1) -- overview and common commands
- MySQL failover and master-slave switchover based on MHA
- Leetcode height checker
- C#&. Net to implement a distributed event bus from 0 (1)
- Don't know how to interview? Test interview questions summary, teach you to face the interview questions
- 给网站添加SSL安全证书
- Configuration of oracle19c under alicloud lightweight application server linux-centos7
- Quelle plate - forme à terme est plus sûre. Je vous en prie.
猜你喜欢

MySQL - table join and join

7hutool actual fileutil file tool class (common operation methods for more than 100 files)

Navigation bar switching, message board, text box losing focus

What are the log files in MySQL?

Dplayer development barrage background

Automatic operation and maintenance 2 - common modules in ansible

Compile time annotation automatically generates dataholder

Teach you how to design interface automation test cases: extract interface information and analyze it

Swift return button

Qt-3-basic components
随机推荐
Comprehensively analyze the key points of knowledge required for interface testing and interface testing
Automation operation and maintenance 1 - installation and deployment of ansible
Configuration of oracle19c under alicloud lightweight application server linux-centos7
流量加密之C2隐藏
What is software testing?
Sort query results according to the input order of fuzzy query jancode
Configuring MySQL master-slave and implementing semi synchronous replication in docker environment
STM32F0-DAY1
2021 the latest selenium truly bypasses webdriver detection
Redisson distributed lock design from a bug
4. procedure flow structure
哪個期貨平臺 交易更安全放心。求推薦。
Disputes between chromedriver, geckodriver, microsoftwebdriver, iedriverserver and operadriver
In the autumn of 2022, from being rejected to sp+, talk about the experience and harvest of YK bacteria in 2021
Reptile essential_ regular expression
Qt-3-basic assembly 2
Open source FTP server FileZilla server
5. array
Redis learning (3) -- persistence mechanism
Mr. Ali taught you how to use JMeter for pressure test (detailed drawing)