Java – references files through classpath in the context of spring

I'm trying to set up org springframework. beans. factory. config. Propertyplaceholderconfigurer spring bean. I have JDBC in Src / main / config properties .. When I put this file in Src / main / resources and classpath: in the value, my application is successfully deployed

This is in JDBC Properties is valid when it is in Src / main / resources

<property name="location" value="classpath:jdbc.properties" />

But I need to put any configuration in Src / main / config. How can I point the spring to this position in the correct way?

Solution

This is a classpath problem, not a spring problem Add Src / main / config to the classpath and it will work In eclipse, this means adding it to the project build path - > source

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>