Java web core technology - web overview

Author : houxue   2023-04-13 11:19:45 Browse: 701
Category : JavaScript

Abstract: 1.The Concept of Web and JavaWeb The Web is a global wide area network, also known as the World Wide Web (WWW), a website that c...

1.The Concept of Web and JavaWeb

The Web is a global wide area network, also known as the World Wide Web (WWW), a website that can be accessed through a browser. In our daily lives, we often use browsers to access websites such as Baidu, JD, and Chuanzhi official websites, which are collectively referred to as web sites.

We know what the Web is, so what is JavaWeb? As the name suggests, JavaWeb is the technology stack that uses Java technology to solve related web and internet fields. There are many technology stacks that need to be understood when developing internet systems using Java language. What are the specific ones?

2.Java Web Technology Stack

Before understanding the Java Web technology stack, it is important to first understand several important concepts.

2.1 B/S architecture

What is the B/S architecture?

B/S architecture: Browser/Server, browser/server architecture mode.

Its characteristics are:

  • The client only needs a browser, and the logic and data of the application are stored on the server side.

  • The browser only needs to request the server to obtain web resources, and the server can send the web resources to the browser.

You can recall our usual online process through the following picture:

B/S architecture

  • Open a browser to access the Baidu homepage, enter the content you want to search for, click Enter or Baidu, and you can obtain content related to the search

  • Consider that the search content is not on our own point, so where does it come from? The answer is clearly returned to us from Baidu server

  • Daily details of Baidu. During holidays and festivals, Baidu's logo will change to different images, and the server will change. The client does not need to do tasks to obtain the latest content

  • So the advantage of B/S architecture is that it is easy to maintain and upgrade: after the server side is upgraded, the client can use the new version without any deployment.

After understanding what B/S architecture is, as a backend development engineer, our main focus in the future will be on the development and maintenance of the server side. In the future, there will be many resources available on the server. What resources are there?

2.2 Static Resources

  • Static resources mainly include HTML, CSS, JavaScript, images, etc., mainly responsible for page display.

  • We have previously learned how to make front-end web pages using HTML+CSS+JavaScript, and using these techniques, we can create web pages with rich effects that will be presented to users in the future. But because the content is static, it will lead to the same content for all people.

  • In the daily process of surfing the internet, in addition to seeing these beautiful pages, we also encounter many dynamic content, such as the common Baidu login effect display. After Zhang San logs in, he sees Zhang San in the upper right corner of the webpage, while after Li Si logs in, he sees Li Si. So most of the content that different users see when accessing the same resource is different. To achieve this effect, static resources alone cannot be achieved.

2.3 Dynamic Resources

  • Dynamic resources mainly include Servlets, JSPs, etc., which are mainly used for logical processing.

  • After the logic of dynamic resource processing is completed, the obtained results will be presented to static resources, and both dynamic and static resources should be used together.

  • Although state resources can handle logic, when users log in to Baidu, they need to enter their username and password. At this point, we also need to solve the problem of the username and password that users fill in during registration, as well as the content display of some data lists that we often access (as shown in the figure below), where are these data stored? Where do we come from when we need it?

2.4 Database

  • The database is mainly responsible for storing data.
  • The entire web access process is shown in the following figure:

Database

  • The browser sends a request to the server to request the required related resources;

  • Resources are divided into dynamic resources and static resources, and dynamic resources can be content written using Java code according to Servlet and JSP specifications;

  • Java code can perform business processing and read data from databases;

  • After receiving the data, submit it to an HTML page for display, and then combine CSS and JavaScript to improve the display effect;

  • The server responds to static resources to the browser;

  • The browser parses these resources and displays the results in the browser, allowing users to see the final results.

2.5 HTTP protocol

  • HTTP protocol: mainly defines communication rules

  • The browser sends requests to the server, and the server responds to data to the browser. The entire process needs to follow certain rules. We have learned about TCP and UDP before, which are all rules. Here, we need to use the HTTP protocol, which is also a type of rule.

2.6 Web Server

Web server: responsible for parsing the HTTP protocol, parsing request data, and sending response data

The browser sends requests and data according to the HTTP protocol, and the backend needs a web server software to parse the requests and data according to the HTTP protocol, and then send the processing results to the browser according to the HTTP protocol

    Sign in for comments!
Comment list (0)

Powered by TorCMS (https://github.com/bukun/TorCMS).