使用Spring的Resource注入app.properties文件,然后读取该配置文件
Topic source@Value("classpath:/logo.txt"),我使用classpath的路径不是eclipse项目下默认的resources路径,
后来使用了@Value("file:盘符+路径/resources/logo.txt"),才正确,我想知道,在eclipse中classpath路径是什么路径?
Spring怎么知道这样写就是在resources目录下,
classpath:/logo.txt
这个classpath路径难道是:F:/eclipse/workspace/web-servlet-hello/src/main/resources/
我在网上看了下,有人说在maven工程下classpath一般就是指src/main/java,src/main/resources,src/main/webapp这几个路径。不知道对不对啊
- 1
SNH48-刘慈欣