Could not resolve placeholder in string value

后端 未结 11 1599
故里飘歌
故里飘歌 2020-12-01 01:00

I am trying to use properties from a .properties file, but it doesn\'t seem to work.

Here is my code:

@Service(\"ServiceFTP\")
@Transact         


        
11条回答
  •  一向
    一向 (楼主)
    2020-12-01 01:35

    You can also try default values. spring-value-annotation

    Default values can be provided for properties that might not be defined. In this example the value “some default” will be injected:

    @Value("${unknown.param:some default}")
    private String someDefault;
    

    If the same property is defined as a system property and in the properties file, then the system property would be applied.

提交回复
热议问题