Dynamic
Eclipse provides the Dynamic Web Project template for creating projects. * A Dynamic Web Project can run on Eclipse's Tomcat server.
This project has a different structure than a Java Project.

-
Java Resources/src- location of Java code. -
src/main/webapp/- document root, where Tomcat looks for files. -
src/main/webapp/WEB-INF/- location ofweb.xml; directory is not available outside web container.
Creating a Dynamic Web Project.¶
Creating a Dynamic Web Project is much like creating a Java Project, with additional configuration steps.
- File->New->Dynamic Web Project. (You may have to select Other and search for this type.)

- Give the project a name.

- Use default settings:
- Project location: use default location.
- Dynamic web module version: 3.1.
- Target runtime:
<none>. - Configuration:
<custom>or Default Configuration.
Select Next > to move to another configuration screen.
- Leave the source folder for Java classes as src, and select Next.

- Leave the content directory as src/main/webapp, and select Generate web.xml deployment descriptor. This creates the
web.xmlfile.

Select Finish.
Drill¶
Create a new Dynamic Web Project called MyHelloWorld. We will add to this project throughout the chapter.