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.
我的自定义库有网络服务。该库中的一个类尝试从本地读取文件。目前该文件位于 Web 服务的 Web Content 文件夹的 WEB-INF 中。我正在使用 Apache Tomcat 7。我应该将文件放在哪里,以便库中的类可以读取文件。
刚试过这个
System.err.println("执行位置:" + new File(".").getAbsolutePath());
找到位置了:)