Dynamic Web Project

Prerequisites

You can find our guideline video in the next chapter to:

  • Download &  install (unpack) Eclipse IDE
  • Download & install tomcat 7
  • Run your first JSP application.
  • Run your first Servlet application

Create New Dynamic Web Project

Launch Eclipse IDE.

Step 1 Create New Dynamic Web Project

Go to File->New->Others… Select Dynamic Web Project under Web category then click Next.

newDynamicWebPrj

Type any name you want in the Project name field.

newDynamicWebPrj#2

Step 2 Configure Target Runtime

  • Click New Runtime… button under Target Runtime.
  • Select Apache Tomcat v7.0. Click Next.

NewServerRuntime

  • Click Browse button to specify Tomcat Server installation directory. The select the folder then click Ok.

newDynamicWebPrj#3

  • Click Installed JREs… button to add/remove or edit JRE definition.

newDynamicWebPrj#4

  • Remove existing one; then click Add button to configure new one. Select Standard VM; then click Next. Click Directory button to select the root folder ofJDK installation. Select the folder then click Ok. Click Finish.
  • Check the JDK then click Ok.
  • Change JRE to the JDK then click Finish.

newDynamicWebPrj#42

Step 3 Generate Deployment Descriptor (web.xml)

  • Click Next. Now choose the folder for your java sources, the default is src. Leave or adjust the default output folder then click Next.

newDynamicWebPrj#5

  • Check Generate web.xml deployment descriptor then click Finish

Now you already have a basic empty dynamic web project. In the next chapter, I’ll show you how to configure & run a simple servlet.

Note: you can generate web.xml later by right click on the project; select Java EE Tools -> Generate Deployment Descriptor Stub.