Heim > Fragen und Antworten > Hauptteil
在maven
中,我需要读取一个本地文件,以为放在resource
目录下就可以了,然而提示找不到文件的错误,不过换成绝对路径能够读取。
另外,如果想在spring
中配置它的路径应该怎么配置呢?
天蓬老师2017-04-17 18:00:15
**<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext.xml</param-value>
</context-param>
classpath: 这个就是指的是maven构建的项目中的resource目录下的路径。你可以试试看。*