How to extend spring by configuring spring xml

前端 未结 2 999
庸人自扰
庸人自扰 2021-01-22 21:38

In a Spring 4 application, we are extending PropertySourcesPlaceholderConfigurer to do some custom task during resolving properties.

To reg

2条回答
  •  一向
    一向 (楼主)
    2021-01-22 22:10

    You can very well use a combination of both Spring based xml and java based config in your spring application.

    You have to use

    @ImportResource({"classpath:sampleapp.xml"})
    

    along with

    @Configuration
    

    Look at the sample post below which explains it:

    Mixing xml and java config with spring

提交回复
热议问题