2016-08-03 62 views
1

让A成为我的核心jar maven项目类。而W是我在另一个项目中的战争。我已经添加了A作为我对W.的依赖项。我在资源文件夹中将我的prop.properties文件存储在A中。如何在我的战争中使用类路径从jar中访问属性文件。使用Spring 4 我已经更新spring.xml与罐子下面:通过类路径在war tomcat中的依赖jar中访问属性文件Spring

<context:property-placeholder 
location="classpath:prop.properties" ignore-unresolvable="true"/> 

回答

7

使用Asteriskclasspath在此之后会告诉春天来寻找配置所有添加的依赖在类路径:

<context:property-placeholder 
location="classpath*:prop.properties" ignore-unresolvable="true"/> 
+0

感谢您的答案...它的工作原理:-)会点击+2 .... –

相关问题