Creating web modules

You can use wizards to create web modules in your Java™ EE project.

Procedure

  1. In the Java EE perspective, right-click your enterprise application project and select New > Web Project to open the web project wizard.
  2. In the Name field, type a name for your new web project.
  3. In the Project Templates section, select the type of web template you want to use:
    Option Description
    Dojo Toolkit Configures the project to have Dojo capabilities. The Dojo resources can be in the project itself, a separate project, or a remote location accessible via HTTP.
    REST Services A project that is configured for REST Services based on JAX-RS
    Simple This creates a basic web project.
    JQuery JQuery Configures the project to have JQuery capabilities. The JQuery resources should be copied in the project itself.
  4. In the Programming Model section, select the programming model that you want to use:
    • Client-side only (HTML, JavaScript,...)
    • Java EE
    • OSGi
    Click Next to configure your new web project.
  5. On the deployment page, from the list of available configuration options, click Deployment to open the Deployment configuration page.
    • The Target runtime field is pre-populated with the selection from the enterprise project.You can change Target runtime by selecting another one from the drop-down box. Click Change Features to open the Project Facets window.
    • Click Add support for WebSphere bindings and extensions or clear this field.
    • In the Web module version field, select the web module version that you want to use.
    • In the EAR membership field, click Add project to an EAR, if you want to include EAR membership; clear this field if you do not want to add the web project to an EAR file.
    • In the EAR project name field, the name of your existent EAR file appears. You can click Browse to select a different EAR file.
    Note: The deployment option is not available if you selected the Client-side only programming model for your new web project.
  6. From the list of available configuration options, click Java to open the Java configuration page.
    • In the Source folders on build path field, accept the default src directory, or click Add Folder, Edit... or Remove to specify a folder for your source files.
    • In the Default output folder: field, specify a folder for your output files or accept the default value (WebContent\WEB-INF\classes).
      Important: If you choose a folder other than WebContent\WEB-INF\classes for your default output folder, the problems view reports a warning:
      Single root warning
      The default for single rootedness problems is set to warning. To change this setting, use the Validation Filters for Project Structure Validator page:
      1. Click Window > Preferences > Validation > Project Structure Validation and then the ... button for Settings.
      2. In the Validation Filters for Project Structure Validator page, specify the default severity level. Available severity levels are Error, Warning, and Ignore.
  7. From the list of available configuration options, click Web Module. On the Web Module configuration page:
    • In the Context root field, type the name of your web project root, or accept the default (which is the name of your web project).
    • In the Content directory field, type the name of your content directory, or accept the default (WebContent).
    • Select Generate web.xml deployment descriptor if you want to create a deployment descriptor. You can also add a deployment descriptor to your web module later.
  8. Click Finish to create your web project.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: tcreatwebmodule.html