Programmatic access to properties created by property-placeholder

后端 未结 9 2402
长情又很酷
长情又很酷 2020-11-29 20:21

I\'m reading properties file using context:property-placeholder. How can I access them programatically (@Value doesn\'t work - I d

9条回答
  •  旧时难觅i
    2020-11-29 21:10

    Let's asume that you the properties file defined in that "parent" framework

    
        
    
    

    You can use the @Value annotation in this way:

    @Value( value = "#{applicationProperties['my.app.property']}" )
    private String myProperty;
    

提交回复
热议问题