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” />

posted @ 2017-10-20 16:14  宇的季节  阅读(127)  评论(0编辑  收藏  举报