loading .properties in spring-context.xml and persistence.xml

后端 未结 2 988
無奈伤痛
無奈伤痛 2020-12-05 02:40

is there a way to reference a .properties file in a spring-context.xml and a JPA persistence.xml?

I think I\'ve seen somewhere an example of this in spring context f

2条回答
  •  遥遥无期
    2020-12-05 03:22

    You can reference external property files from a Spring bean definition file using a PropertyPlaceholderConfigurer. I don't think that will work for a JPA persistence.xml, although Spring's JPA support allows you to incorporate most, if not all, the content of persistence.xml into the beans file itself, in which case it would work fine.

提交回复
热议问题