Bug 582406 - Cannot avoid web.xml creation even if option unchecked during project creation
Summary: Cannot avoid web.xml creation even if option unchecked during project creation
Status: NEW
Alias: None
Product: EPP
Classification: Technology
Component: jee-package (show other bugs)
Version: 4.28 / 2023-06   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: later   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-13 17:40 EDT by Nykyta Kudria CLA
Modified: 2023-09-13 17:40 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nykyta Kudria CLA 2023-09-13 17:40:25 EDT
Overview:
Hello everyone,
I can’t avoid web.xml creation under src/main/webapp folder in a new Dynamic Web Project 6.0 after adding a servlet. I would like to use annotations instead of web.xml. In Dynamic Web Project 3.0 no matter if I select “Generate web.xml deployment descriptor” or not it will route servlets using the @WebServlet("/my-route") annotation and not using web.xml. Is it possible to have the same behavior in Dynamic Web Project 6.0.

Steps to reproduce:
    1. File -> New -> Dynamic Web Project
    2. Select for Target Runtime “wildfly 27+” and dynamic web module version 6.0
    3. Click next twice and leave “Generate web.xml deployment descriptor” unchecked.
    4.	Next in “Project Explorer” expand “Java Resources” and then right click on “src/main/java” and create a new servlet with a given url mapping.
    5.	 See that the routing is done using a web.xml file located in src/main/webapp even though we left “Generate web.xml deployment descriptor” unchecked.

Actual Results:
Routing still done via web.xml

Expected Results:
No web.xml and routing done only via annotations.