Spring 集成 XML 配置和 Spring 引导 Java 注释配置
Spring Integration XML Configuration and Spring Boot Java Annotation Configuration
是否可以同时进行spring集成xml配置和spring引导java注解配置?你能举个例子吗?
这方面的最佳做法是什么?
谢谢
正如 Marten 指出的那样,将 Spring Boot 与 XML 配置结合起来完全没问题。请参阅 Spring 引导文档:https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using.configuration-classes.importing-xml-configuration
If you absolutely must use XML based configuration, we recommend that you still start with a @Configuration
class. You can then use an @ImportResource
annotation to load XML configuration files.
是否可以同时进行spring集成xml配置和spring引导java注解配置?你能举个例子吗? 这方面的最佳做法是什么?
谢谢
正如 Marten 指出的那样,将 Spring Boot 与 XML 配置结合起来完全没问题。请参阅 Spring 引导文档:https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using.configuration-classes.importing-xml-configuration
If you absolutely must use XML based configuration, we recommend that you still start with a
@Configuration
class. You can then use an@ImportResource
annotation to load XML configuration files.