How to extend spring by configuring spring xml

前端 未结 2 994
庸人自扰
庸人自扰 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

    0 讨论(0)
  • 2021-01-22 22:11

    I had the same problem, my problem was fixed simply with placing the bean of my class in my Springbeans.xml file like below:

    <beans:bean class="MyPropertyConfigurer"/>
    
    0 讨论(0)
提交回复
热议问题