java - maven 打开一个普通文件,应该使用什么路径?
PHPz
PHPz 2017-04-17 17:58:15
0
1
306

maven中,我需要读取一个本地文件,以为放在resource目录下就可以了,然而提示找不到文件的错误,不过换成绝对路径能够读取。
另外,如果想在spring中配置它的路径应该怎么配置呢?

PHPz
PHPz

学习是最好的投资!

reply all(1)
Peter_Zhu

**<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext.xml</param-value>
</context-param>
classpath: This refers to the path under the resource directory in the project built by maven. You can try it. *

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template