Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将一些 xml 写入 webapp 的子目录中的文件。假设在这种情况下,目录是:
C:\Tapestry\xyz\src\main\webapp\directory1\
如何从其中一个 java 类中获取文件路径的一部分,即 C:\Tapestry\xyz\src\main\webapp\?我不想硬编码它,因为那样它就不能移植了。
谢谢,