Is there a way to specify a default property value in Spring XML?

后端 未结 7 919
傲寒
傲寒 2020-12-02 07:17

We are using a PropertyPlaceholderConfigurer to use java properties in our Spring configuration (details here)

eg:

         


        
7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 07:25

    
       ${my.server.port:8088}
    
    

    should work for you to have 8088 as default port

    See also: http://blog.callistaenterprise.se/2011/11/17/configure-your-spring-web-application/

提交回复
热议问题