spring - read property value from properties file in static field of class

后端 未结 6 1126
一向
一向 2021-02-06 12:07

I have one utility class where i have one method which requires username and password to connect other url. I need to kept that username in properties file so that i can change

6条回答
  •  渐次进展
    2021-02-06 12:38

    Spring doesn't allow to inject values into non-final static fields but make your field private and it should works.

提交回复
热议问题