Illustration Spring: mechanism and process flow of the HTTP request [5]

5. HTTP request processing instructions associated profile

HTTP request through the entire space is hierarchical, comprising: Web container, Web application, Spring frameworks, which are each configured by the initialization configuration file, which is a loosely coupled architecture. Now let's sort out what these configuration files, HTTP request is the first across the Web container, it represents the product Tomcat configuration file is server.xml.

server.xml

The second path is through the Web application, which consists Listener \ Filter \ Servlet and other components, the main configuration file is web.xml.

web.xml

The third crossing is the Spring Framework, which itself is divided into three layers: the presentation layer, a data layer and a source layer art, these layers are of different configuration file to configure the maintenance performance layer is formed by mvc-servlet.xml, art layer is formed by the applicationContext.xml, the data source layer is configured by object-relational mapping framework assembled ORM (Hibernate \ iBatis \ MyBatis etc.) profile sqlmap-mapping.xml, jdbc.properties other, the correspondence relationship may specifically with reference to FIG. :

Spring configuration file

Veterans brother introduced me to this part of the reason it is to help you build a concept, it is the entire system from the outside layer of the inner layer of the package out of the building, and inside each layer is like building blocks to build out different types of components , and between layers, each layer is through the interior of the adapter profile. If you want more in-depth grasp of the entire application system architecture, we can put it above several profile as the entry point or a clue. Considering the theme of this paper is to analyze the mechanism of the HTTP request processing flow, we will not discuss the expansion.

6. HTTP request handling instructions Frequently Asked Questions

In everyday system development or maintenance of them, most of the problems are associated with the HTTP request processing. Some of which are our own are not familiar with the HTTP protocol, HTTP protocol is the Internet system integration of the various main application layer protocol, the protocol design is very good, we can take a moment to study in depth this agreement, of course, if there is time to It comes with TCP / IP protocol, in particular the agreement to control the quality of service parameters of various types.

In addition, there is mostly unfamiliar with the whole process HTTP request processing, do not know in what part of setting a breakpoint debugging, and configuration files are not required to complete and so on, so it is easy to find yourself in a maze, spend a lot of time energy have no clue clue.

The main value of this paper is to help you sort out the end of the whole process framework, that is, we often say that the global perspective or the perspective of God. With this framework After that, we can find what you want to find information related to the nodes according to their needs to study learning, and will not fall into the details not find the direction.

Of course, taking into account the work of each of us to learn different situations, problems usually encountered is different, this article can not cover all problems encountered, welcome to leave a message to ask questions, I also welcome the attention of the public micro-channel number "IT veteran brother." interaction, I will try to answer your questions as soon as possible, thank you!

Other articles in this series, the index is as follows:

 

Guess you like

Origin www.cnblogs.com/itlaobingge/p/11963380.html