如何从类Spring获取属性

时间:2015-01-20 15:10:19

标签: spring

有没有办法改变

<context:property-placeholder location="file.properties" />

进入一个包含每个属性的函数的java类?例如,file.properties

a=1
b=2

写一堂课:

class Props {
    public A getA() {return 1;}
    public B getB() {return 2;}
}

0 个答案:

没有答案