Creating dynamic Web projects
You create and maintain the resources for your Web applications in Web projects.
Unlike with static Web projects, dynamic Web projects enable you to create resources such as JavaServer Pages and servlets.
To create a new dynamic Web project, complete the following steps:
- Open the J2EE or the Web perspective.
- Right click in the Enterprise Explorer, and from the pop-up menu select
New | Dynamic Web Project
The New Dynamic Web Project wizard starts.
- Follow the project wizard prompts.
General Information
- Project Facets
- A facet represents a unit of functionality in a Web project. For example, the Dynamic Web Module facet enables the project to be deployed as a dynamic Web module. A brief description of a project facet appears in the wizard when you select it. Note that in many instances, you can view the constraints for a project facet by right clicking on the facet and selecting project constraints from the pop up menu. You can select facets for your Web project by clicking Modify in the Configuration section of the Dynamic Web Project page of the wizard.
- Target Runtime
- Use this field to define a new installed runtime environment. Runtimes are used at build time to compile projects.
- Configurations
- Use this to select a set of pre-defined configurations. For example, if you select JavaServer Faces IBM Enhanced Project in the Configurations drop-down list, then the JavaServer Faces (IBM Compatibility) facet and the JavaServer Faces (IBM Enhanced) facet will automatically be selected in the Project Facets page of the wizard.
- Enterprise Application project (EAR Project)
- A new or existing Enterprise Application project (EAR Project) must be associated with your new Web project to facilitate deployment. If you want to override the default settings for the Enterprise Application project, you can do so using the wizard. When your Web project is created at the end of the wizard, the new Enterprise Application project is also created with the name specified in the EAR project field. Note that the default is the name of the web project appended with EAR (unless the ear project was selected when you opened the wizard.)
- Context Root
- The context root is the Web application root, which is the top-level directory of your application when it is deployed to the Web server. You can change the context root after you create a project by right clicking on the project, selecting Properties from the pop-up menu, and selecting Web Project Settings. The context root can also be used by the links builder to ensure that your links remain ready to publish as you move and rename files inside your project.
- Deployment descriptor
- The deployment descriptor is a configuration file that describes how to deploy a module by specifying configuration and container options. By default a deployment descriptor is created for a Web project because it is required to run a servlet on an application server. If your Web application does not contain any servlets, filters, or listeners, you can clear the Generate deployment descriptor checkbox. If you do not generate a deployment descriptor when you initially create your Web project, you can generate the descriptor at a later time. Right-click your Web project and select
Java EE | Generate Deployment Descriptor Stub