How to correctly specify a default value in the Spring @Value annotation?

后端 未结 6 1450
伪装坚强ぢ
伪装坚强ぢ 2020-12-15 02:57

Initially, I have the following spec:

@Value(\"#{props.isFPL}\")
private boolean isFPL=false;

This works fine correctly getting the value f

6条回答
  •  余生分开走
    2020-12-15 03:44

    Depends on how you're loading your properties, if you use something like

    Then @Value should look like

    @Value("${isFPL:true}")
    

提交回复
热议问题