Spring混合配置

Spring混合配置

一、JavaConfig中引入其他配置

  1. JavaConfig中引入JavaConfig配置

    使用@Import({OtherConfig1.class,OtherConfig2.class}

  1. JavaConfig中引入XML配置

    使用@ImportResourceclasspath:other-config1.xml

二、XML中引入JavaConfig配置

  1. XML中引入XML配置

    使用<import resoune=”other-config.xml”/>

  1. XML中引入JavaConfig配置

    使用<bean class=”config.OtherConfig” />

原文地址:https://www.cnblogs.com/chenkeyu/p/7700052.html