tomcat webapps目录绝对路径? [英] tomcat webapps directory absolute path?

查看:44
本文介绍了tomcat webapps目录绝对路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个地方有 tomcat 提取物,而我的 webapps 目录可能在其他地方.那么如何获取我的 Web 应用程序的绝对路径呢?.我在 webapps 中有我的文件处理程序,我想找到我的 webapps 或我的应用程序目录的绝对路径(从 c:/或/home/use/../../webapp/mywebapplication 开始).问题是我无法控制我的应用程序将部署在谁/何处?

I have tomcat extract in one place and my webapps directory may be somewhere else. Then how to get absolute path of my web application? . I have my file handling programme inside webapps and i want to find absolute path of my webapps or my application directory(starting from c:/ or /home/use/ ../../webapp/mywebapplication like that ). Thing is I dont have control on who/where my application is going to be deployed ?

推荐答案

参见 ServletContext.getRealPath

这篇关于tomcat webapps目录绝对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆