0

I have installed a brand new Eclipse Java EE version. But my web.xml is not updating automatically as it should while creating a Servlet. Initially it just has the welcome tags, that is all.

4

1 回答 1

0

这可能是因为您使用的是 Servlet 3.0 规范。web.xml它不需要映射。检查您的 servlet 中是否有WebServlet注释。它应该做所需的事情。

Servlet 3.0 使用注解进行 URL 映射,而不是web.xmlservlet 配置标签。

例如,如果您正在创建一个名为HelloServletthen的 Servlet HelloServlet,您将在其中看到WebServlet注释。

于 2013-08-12T12:55:13.033 回答