IntelliJ IDEA 14.1.0 Help

Enabling Web Application Support

You can enable Web application development support when creating a project or module. You can as well do that for an existing project or module.

In all such cases, IntelliJ IDEA creates 1) the folder web with index.jsp intended as a starting page of your application and, optionally, WEB-INF/web.xml application deployment descriptor, 2) a Web facet which, among other things, lets you manage your deployment descriptors and 3) an exploded WAR artifact configuration. Additionally, the Web tool window becomes available for working with the Web part of your application.

Enabling Web app development support when creating a project or module

  1. Do one of the following:
    • If you are going to create a new project: click Create New Project on the Welcome screen or select File | New | Project.

      As a result, the New Project wizard opens.

    • If you are going to add a module to an existing project: open the project you want to add a module to, and select File | New | Module.

      As a result, the New Module wizard opens.

  2. On the first page of the wizard, in the left-hand pane, select Java. In the right-hand part of the page, specify the JDK that you are going to use.
  3. Under Additional Libraries and Frameworks, select the Web Application check box.

    Select the version of the Servlet specification to be supported from the Versions list.

    If you want the deployment descriptor web.xml file to be created, select the Create web.xml check box.

    Click Next.

  4. Specify the name and location settings. For more information, see Project Name and Location or Module Name and Location.

    Click Finish.

Enabling Web app development support for an existing project or module

  1. Open the Project tool window (e.g. View | Tool Windows | Project).
  2. Right-click the project or the module folder and select Add Framework Support.
  3. In the left-hand pane of the Add Frameworks Support dialog that opens, select the Web Application check box.
  4. In the right-hand part of the dialog, select the version of the Servlet specification to be supported from the Versions list.

    If you want the deployment descriptor web.xml file to be created, select the Create web.xml check box.

  5. Click OK in the Add Frameworks Support dialog.

Managing deployment descriptors

Open your Web facet settings. For corresponding instructions, see Changing Facet Settings.

Your application deployment descriptors are shown in the area under Deployment Descriptors. Use:

  • add (Alt+Insert) to create a new web.xml deployment descriptor. (You can do that only if no web.xml is currently associated with your application.)
  • The Add Application Server specific descriptor button to create an application server-specific deployment descriptor.
  • edit1 (Enter) to replace the selected descriptor file with a different one.
  • delete (Alt+Delete) to remove the association of the selected descriptor with your application and, optionally, to physically delete the corresponding file.

For more information, see Web, EJB and Java EE Application Facet Pages.

Managing application artifacts

To deploy your application to a server, you need an application artifact. For Java Web applications, IntelliJ IDEA provides the following artifact formats:

  • Web Application: Exploded. This is a decompressed Web application archive (WAR), a directory structure that is ready for deployment onto a web server.
  • Web Application: Archive. This is, obviously, a WAR file.

To manage your artifact configurations, use the Project Structure dialog. If you go there now (e.g. File | Project Structure | Artifacts), you'll see that there is already one exploded WAR artifact configuration created for you by IntelliJ IDEA.

basic_artifact_configuration

See Also

Last modified: 14 July 2015