Is it possible to use placeholder in context.xml

前端 未结 2 1942
星月不相逢
星月不相逢 2021-01-13 17:20

I\'m using Spring and struts and have the following entry in \'/META-INF/context.xml\'




        
2条回答
  •  说谎
    说谎 (楼主)
    2021-01-13 17:57

    It's not possible using Spring's PlaceholderPropertyConfigurer (which only replaces values inside Spring context).

    It is, however, possible using Ant during build process using Replace task. Something like:

    
    

    Note that the above takes property names as tokens to be replaced - e.g. you'll need to use "jdbc.url" and not "${jdbc.url}" in your context.xml. If latter is absolutely required it can be achieved by explicitly naming tokens to be replaced as nested elements.

提交回复
热议问题