References between multiple Xml configuration files in Spring

Source: Internet
Author: User

Today, we used to set up multiple spring2 XML files, because setting multiple files makes it easier to maintain and manage them.

I added a beans-config.xml file with some special bean settings, but there is a reference relationship with bean in applicationcontext. XML,
I wrote in a beans-config.xml file:

  1. <Import resource = "applicationcontext. xml"/>

In this case, the involved logic is normal. In the same way, I set it in the applicationcontext. xml file.

  1. <Import resource = "beans-config.xml"/>

In addition

  1. <Context-param>
  2. <Param-name> contextConfigLocation </param-name>
  3. <Param-value>/WEB-INF/applicationContext. xml,/WEB-INF/beans-config.xml </param-value>
  4. </Context-param>

However, when the init spring context was started, it was not found that the applicationcontext. xml file does not need to be written <import/> as long
.

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.