idea中src/main/resources目录下的applicationContext.xml文件访问src/main/webap目录下的配置文件

如图所示,想要在src/main/resources目录下的applicationContext.xml文件中访问src/main/webap目录下的db.properties,需要两步:

  1. applicationContext-dao.xml中进行配置(classpath:后的路径看情况可自行修改):
    <context:property-placeholder location="classpath:db.properties"/>
  2. 将webapp目录下的peoperties改成“Resources Root”

idea中src/main/resources目录下的applicationContext.xml文件访问src/main/webap目录下的配置文件

相关文章:

  • 2022-12-23
  • 2021-05-31
  • 2021-12-10
  • 2022-12-23
  • 2021-05-15
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-30
  • 2021-05-24
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案