Have you created Dynamic Web Project and created servlet and still are you missing
web.xml file under
Eclipse allows you to NOT create a web.xml file when you create Dynamic Web Project for Java EE 6, since the Java EE 6 spec (in general) and Servlet 3.0 spec (in particular) attempt to de-emphasize deployment descriptors.
To change the url-mapping for a Servlet 3.0 servlet, the first place to look is in the source code for the servlet. Look for (and change) the value of the urlPatterns element.
If you are trying to create a web app based on Servlet 3.0, try to avoid creating a web.xml file.
But still if you need
web.xml then you can do it by
- Dynamic Web Project
- Right Click
- Java EE Tools
- Generate Deployment Descriptor Stub
You should see
web.xml file immediately after that.
Now it’s time to deploy project to Tomcat Web Server. Right click on Server and click
Add and Remove.
Then add your recently converted Dynamic Web project to
Configured section at right and you should be all set.
Join the Discussion
Share & leave us some comments on what you think about this topic or if you like to add something.