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.
我需要我的 webapp 来使用我生成的 jar 中的类文件,而不是目录 /classes。 如果我将我的 jar 添加到 lib 目录,我的应用程序是否会运行而无需向我的 web.xml 添加映射?
源代码适用于人类,而不是 webapps。您需要编译这些类,将它们打包成一个 jar 文件并将其放入WEB-INF/lib.
WEB-INF/lib
编辑:
如果您将 jar 文件放在WEB-INF/lib目录中,webapp 将自动拾取它。无需向web.xml.
web.xml