shortcut for injecting strings with spring

前端 未结 3 2278
刺人心
刺人心 2021-02-20 01:01

I inject Strings in my spring config by doing the following:


    

        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-20 01:43

    There is no need to create a bean of type String. Just pass the value to constructor-arg:

    
        
    
    

    works.

提交回复
热议问题