更新时间:2023-10-17 20:33:10
您的Web应用程序在服务器上的JVM中运行。应用程序的根文件路径通常是Tomcat服务器的文件夹。要获取此文件夹路径,您可以轻松执行以下操作:
Your web application runs within a JVM on the Server. The root file path of your application is typically the folder of your Tomcat Server. To get this folder path you can easily do the following:
String sRootPath = new File("").getAbsolutePath();
您可以将文件保存在由您创建的子文件夹中,或者您在服务器上的某处有一个额外的文件夹filesystem。
You could save your files in a subfolder created by you or you have an extra folder somewhere on the servers filesystem.