Is there a shorthand for creating a String constant in Spring context XML file?

后端 未结 4 978
[愿得一人]
[愿得一人] 2021-02-01 14:36

I need to define a string value in Spring context XML file that is shared by multiple beans.

This is how I do it:

<         


        
4条回答
  •  爱一瞬间的悲伤
    2021-02-01 15:07

    Something I've used in the past is SpEL to make sure that a bean has the same value as another:

    
        
    
    
    
        
    
    

    I have found this to be particularly useful when setting the value did something other than a simple assignment.

提交回复
热议问题