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.
我有自己的 JAR 库,它位于我的 Java EE 5 WebApp 的类路径中。该 JAR 中的类需要访问 WebApp 资源中的文件。
问题是:
如何从 WebApp 的类路径中的 JAR 库访问 WebApp 内的文件?
ServletContext.getRealPath("/WEB-INF/my.txt")给出一个文件。