@Value in Springboot returns null

前端 未结 5 972
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 00:22

I have the application.properties, which is located in the resources

apllication.properties

hsm.provider=software
hsm.name=TestHsm
h         


        
5条回答
  •  没有蜡笔的小新
    2021-01-18 01:04

    Judging by your package structure, those properties should definitely be loaded. Only possible option is that you have instantiated your Controller class as new Controller() instead of letting spring injecting the class (using @Autowired or constructor injection).

提交回复
热议问题