Spring - set a property only if the value is not null

前端 未结 6 1686
星月不相逢
星月不相逢 2020-12-14 01:28

When using Spring, is it possible to set a property only if the value passed is not null?

Example:


          


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 02:16

    This looks like a job for Java-based container configuration. You'll be able to do what you do in your XML config, but with all the power of Java.

提交回复
热议问题