One, when using the Spring Series framework, we need to configure spring's listening on the Web. xml: Contextloaderlistener
The Contextloaderlistener function is to automatically load the corresponding applicationcontext.xml and other configuration files when the Web container is initialized to help spring complete other initialization operations
Syntax is
This way, by default, when the Web container starts, the system automatically looks for a file called Applicationcontext.xml from the Web-inf folder and loads it for initialization!
But we can also modify the storage location of Applicationcontext.xml and other configuration files!
At this point, you need to use a context parameter called Contextconfiglocation.
With this parameter, we can manually specify the location of the configuration file.
This tells the spring framework where the specific configuration file is stored, so that the framework can be initialized!
Summarize:
There are two types of spring configuration file storage locations
1, put the configuration file directly under the Web-inf folder, and then declare a listener in Web. Xml!
2, put the file in any directory of the project, but to add the <context-param> parameter in Web. XML, use it to indicate where the configuration file is stored for the Web container to load, and then declare a listener!
"Spring" knowledge points about SPRINGMVC monitoring