recherche

Maison  >  Questions et réponses  >  le corps du texte

java - maven 打开一个普通文件,应该使用什么路径?

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

PHPzPHPz2890 Il y a quelques jours315

répondre à tous(1)je répondrai

  • 天蓬老师

    天蓬老师2017-04-17 18:00:15

    **<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-v alue>classpath*:applicationContext.xml</param-value>
    </context-param>
    classpath : Il s'agit du chemin sous le répertoire des ressources dans le projet construit par maven. Vous pouvez l'essayer. *

    répondre
    0
  • Annulerrépondre