how to get relative path of current directory in tomcat from linux environment using java

后端 未结 3 1263

I would like to use to read properties file from out side of the my web application. I was deployed a war file in tomcat in windows environment and I am able to read properties

3条回答
  •  爱一瞬间的悲伤
    2021-02-04 18:21

    This is not a robust way to go about it. If you want your webapp to consume data from 'outside', then call System.getProperty to get an absolute pathname that you, yourself, specify with -D in the tomcat config script.

提交回复
热议问题