如何使用java查找webapps目录的路径
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21745970/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to find the path of webapps directory using java
提问by NoNaMe
Is there some way to find the path of tomcat's webapps directory using java, as we use System.getProperties("...")
to get user.dir
etc
有什么方法可以使用java找到tomcat的webapps目录的路径,就像我们System.getProperties("...")
用来获取user.dir
等
thanks in advance.
提前致谢。
采纳答案by Dark Knight
You can use System.getProperty( "catalina.base" )
for same. And add "/webapps"
to path.
您可以使用System.getProperty( "catalina.base" )
相同的。并添加"/webapps"
到路径。