One, the Web application
1.1. What is a Web application?
Web applications are generally referred to as Web sites, consisting of servers, client browsers, and networks. But web programs are not the general meaning of the site, the general site is to provide information services, heavy content, the program is often relatively simple, but commercial web programs are often more complex, behind the combination of databases and other technologies.
1.2, b/S and C/s structure
Depending on whether the network is needed, the program can be divided into network programs and non-network programs. The network program can be divided into B/s structure and C/s structure.
c/S refers to the client/server mode. The client of this mode needs to install a PCR program. The PCR program is responsible for exchanging data with the server. The General network program is the C/s structure. such as Qq,,lol and so on. The disadvantage is that when the server side upgrades, the client also to upgrade, which will cause problems for the client, but also occupy resources .
b/s refers to the browser (Browser)/server mode. The general website is b/s structure. Like Google,baidu. Web application access does not require the installation of a client program and can be accessed by any browser to access the Wen application. The client does not need to make any changes when the Wen application is upgraded.
1.3. Web Access Fundamentals
Ii. URL, urn, and URI
Web application files and other resources are placed on the server, and the server is the host on the Internet, the browser wants to get resources from the server, that is, or the browser to the server where to obtain resources? , then you need to use the URL.
2.1. URL
url:uniform Resource Locator Uniform Resource Locator. URL is A concise representation of the location of resources and access methods available from the Internet, and is the address of standard resources on the Internet [Baidu]. The main formats are:
< agreements >:< specific protocol sections >
The agreement specifies the manner in which resources are obtained. Some examples of agreements:
FTP (Text Transfer Protocol, File Transfer Protocol)
Http (Hypertext Transfer Protocol, Hypetext Transfer Protocol)
mailto (email)
File (specific host file name)
After the agreement follows: number, the format of the specific protocol section is:
< user >:< password >@< host >:< port number >/< path >
2.2. URN
urn:uniform Resource name Uniform resource names. Represents a unique name for a resource.
Uniquely identifies an identifier for an entity, but cannot give the location of the entity. The system can first look for an entity locally before it tries to find the entity on the web. It also allows the Web location to change, but the entity can still be found [Baidu].
2.3. URl
uri:uniform Resource Ide ntifer Uniform Resource Identifier. The basic form of an address on the web is the URI, which represents the Uniform resource identifier, in two forms, the URL and the Urn,url and urn as a subset of the URI.
Third, HTTP Hypertext Transfer Protocol
3.1. What is HTTP?
The HTTP protocol is an application-layer communication protocol between the browser and the server, which is a protocol based on TCP/IP. In short, it is the way the browser and the server talk to each other.
3.2. HTTP Features
HTTP has two basic but extremely important features:
①: Demand-based (request)/response (Response) model
HTTP is a request/response-based communication protocol that makes only one request/response per connection, and is a simple communication protocol that does not respond without a request.
②: Stateless (stateless) communication protocol
Under the HTTP protocol, the server side is a forgetful guy, after the server responds to the client, it will not remember the client's information, and will not maintain the state associated with the client, so the HTTP protocol is also known as a stateless communication protocol.
3.3. HTTP request
When a browser makes a request using HTTP, it can have multiple request methods, such as GET, POST, HEAD, PUT, delete, and so on. But for a servlet or JSP to write, the most common contact is the Get and post two request methods.
The requested data contains three parts: a request line, a request header, a request body
3.3.1, GET request
Java Web (i) Preface and architecture