Introduction to the Web

web-based

What are the parts of a web application?

  • Static Web: html, css, js
  • Dynamic Web: jsp, servlet
  • java program
  • Jar package
  • configuration file

What is the difference between static web and dynamic web?

  • Static: everyone sees the same page, usually written in JavaScript, unable to interact with the database, unable to achieve data persistence.

  • Dynamic: The pages you see vary from person to person, and you can interact with the database.

Web common technology?

  • PHP:

    • Fast development, powerful functions, cross-platform, simple code

    • Unable to handle large traffic

  • JSP/Servlet:

    • B/S structure

    • Overcoming three high problems: high availability, high concurrency, and high performance

web server

What is Tomcat?

What is tomcat?

Tomcat is a lightweight server that can provide web services. Without using Tomcat, accessing local files is like this:

file:///D:/test.html

Access using Tomcat is like this:

127.0.0.1:8080/test.html

Put the local file into the network.

How to publish a website?

Put the website you wrote yourself under the specified Web application folder (webapps) in the server (Tomcat), and you can access it.

So in fact, Tomcat should be more useful for beginners like us to try on their own. The websites we usually visit (Baidu, Taobao, etc.) seem to have nothing to do with Tomcat.

HTTP

What is HTTP?

Hypertext Transfer Protocol. Port number 80, HTTPS port number 443

text: html, string...

Hypertext: pictures, audio, video, location, map...

The characteristics of the two eras?

HTTP/1.0: one connection, one web resource

HTTP/1.1: one connection, get multiple web resources

What are the main methods of HTTP?

method meaning
GET Get the information specified by the URL. If a file is specified, the file content is returned; if a CGI program is specified, the output data of the program is returned.
POST Send data from client to server.
PUT Replace the file on the server specified by the URL. Create the file if it does not exist.
DELETE Delete the file on the server specified by the URL.
HEAD Basically the same as GET, but it only returns the HTTP message header, not the content of the data. Used to obtain attribute information such as the last update time of the file.
OPTIONS Used for notification or query communication options.
TRACE Return the request line and header received by the server directly to the client. Used to check for rewritten requests in environments using proxies.
CONNECT The method to use when using a broker to transmit encrypted messages.

What is the difference between GET and POST?

  • GET: The request can carry relatively few parameters, the size is limited, and the data content will be displayed in the URL address bar of the browser, which is not safe but efficient
  • POST: There is no limit to the parameters that the request can carry, and there is no limit to the size. The data content will not be displayed in the URL address bar of the browser. It is safe but not efficient

Servlet

What are Servlets?

Servlet is a Java-based dynamic Web development technology introduced by Sun. It is a set of Java APIs, you only need to implement it according to the specification.

Learn this first, learn later and add...

Guess you like

Origin blog.csdn.net/qq_50209297/article/details/130554262