Where do I put my XML beans in a Spring Boot application?

后端 未结 3 815
小鲜肉
小鲜肉 2020-12-23 22:47

I\'m getting back into Spring (currently v4). It\'s all wonderful now with @SpringBootApplication and the other annotations but all the documentation seems to f

3条回答
  •  清歌不尽
    2020-12-23 23:23

    As long as you're starting with a base @Configuration class to begin with, which it maybe sounds like you are with @SpringBootApplication, you can use the @ImportResource annotation to include an XML configuration file as well.

    @SpringBootApplication
    @ImportResource("classpath:spring-sftp-config.xml")
    public class SpringConfiguration {
      //
    }
    

提交回复
热议问题