Where is web.xml in Eclipse Dynamic Web Project

Viewed 159317

In Eclipse I clicked File->New->Dynamic Web Project and I am following a tutorial for Jersey that now wants me to go and change something in web.xml file...but I can't even find this file. What is it I am doing wrong?

enter image description here

12 Answers

Follow below steps to generate web.xml in Eclipse with existing Dynamic Web Project

  1. Right Click on Created Dynamic Web Project
  2. Mouse Over Java EE Tools
  3. Click on Generate Deployment Descriptor Stub
  4. Now you are able to see web.xml file on WEB-INF folder

enter image description here

For gradle / maven project you can use src/main/webapp/WEB-INF folder by default:

- main
- - java
- - resources
- - webapp
- - - META-INF
- - - - context.xml
- - - WEB-INF
- - - - web.xml

If your deployment descriptor tab is disabled, then click on update libraries it will also do your work. It will create. Xml file in Web content

You can try this: right-click on the project and select Java EE Tools -> Generate Deployment Descriptor Stub. web.xml should be generated.

I think you are creating a project in the wrong way,I am going to post here in step by step

Step 1: File>>New>>Project>>Web>>Dynamic Web Project

Step 2: Enter Project Name>>Next>>Next>>

Step 3: Check the checkbox for Generate web.xml deployment descriptor

Step 4: Finish

Please follow this way you will get you web.xml file under WEB-INF folder

Related