"Spring" knowledge points about SPRINGMVC monitoring

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.