Spring @Value annotation always evaluating as null?

前端 未结 6 1170
别跟我提以往
别跟我提以往 2020-12-05 09:33

So, I have a simple properties file with the following entries:

my.value=123
another.value=hello world

This properties file is being loaded

6条回答
  •  旧巷少年郎
    2020-12-05 10:18

    As its working with @Controller, it seems you are instantiating Config yourself. Let the Spring instantiate it.

提交回复
热议问题