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

后端 未结 6 1415
伪装坚强ぢ
伪装坚强ぢ 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:45

    For int type variable:

    @Value("${my.int.config: #{100}}")
    int myIntConfig;
    

    Note: there is no space before the colon, but an extra space after the colon.

提交回复
热议问题