In Eclipse, I create a dynamic web project ( Dynamic web module version 3.0
), tick automatic generation of web.xml
. I create a servlet where servlet mapping
specified.
The servlet starts, everything is fine, everyone is happy, except that web.xml
itself is empty (well, not completely empty, but servlets are not marked there). In the project itself there is a Deployment descriptor: ServletProject
, where servlets and filters Deployment descriptor: ServletProject
out just the same. In addition to this, an annotation of the form @WebServlet("/ServletName")
added to the servlet itself.
Actually 2 questions:
- How to make everything related to servlets generated in
web.xml
? - Why does Eclipse do this? What are the pros / cons?