Create a Java module from scratch.
- On the fourth, Select the desired technologies, page of the wizard, select the Web Application check box.
From the Version drop-down list, select the relevant specification.
The available options are:
- 2.2 - 2.5 - if you choose one of these options, IntelliJ IDEA will create a Web application deployment descriptor for you automatically.
- 3.0 - if you choose this option, select the Create web.xml check box to have a Web application deployment descriptor created. Clear the check box to use annotations instead.
- Add a Web facet to the module and open its settings. The right-hand pane shows the Web Facet settings.
- The Deployment Descriptors area shows the location of the web.xml deployment descriptor, which is already created for you. To change its location or version, click (EnterEnter).
- To assign another existing descriptor, click (Alt+DeleteCommand Delete) and confirm deletion in the Delete Deployment Descriptor dialog box that opens. To have the current descriptor removed from your computer, select the Also delete file from disk check box and click Yes. In the Deployment Descriptors area, where IntelliJ IDEA returns you, click (Alt+InsertCommand N; Command Enter) and select the desired version and file in the Deployment Descriptor Location dialog box that opens.
- If your application server needs a proprietary deployment descriptor, click the Add Application Server Specific Descriptor button and select your server from the list.
No matter whether you are creating a module from scratch or adding a Web facet to an existing module, IntelliJ IDEA detects conflicts and suggests to resolve them.
- If some required libraries are missing, click the Fix button. The necessary libraries will be downloaded and installed automatically.
- If the facet resources are not included in any of the previously configured artifacts, click the Fix button and choose the appropriate artifact from the list.
- If no artifacts of the relevant type are configured, click the Create Artifact button and configure the artifact layout on the Artifacts page of the Project Structure dialog box that opens.