How to access file in the static resources(WEB-INF) folder from the referencing java project?

后端 未结 4 712
感情败类
感情败类 2021-01-15 02:00

I have a web application, that contains a configuration xml file for one of my application services that is exposed as spring bean. Also I have a standalone java application

4条回答
  •  抹茶落季
    2021-01-15 02:33

    It's a classpath resource, so put it on the classpath: $webapp/WEB-INF/classes

    Maven projects will copy things in $module/src/main/resources to this location when packaging the webapp. (the former is a sourcepath, the latter - WEB-INF/classes - is always put on the classpath by the servlet container, per spec.)

提交回复
热议问题