IntelliJ IDEA 14.0.0 Web Help

Enabling Web Application Support

The dedicated Web facet provides facilities for developing Web applications, sets up the relevant module structure, and creates the required deployment descriptors. You can create a new module with a dedicated Web Application facet from scratch or add a facet to an existing module.

IntelliJ IDEA configures the module as follows:

  • Creates the structure of the module with the web and WEB-INF nodes.
  • Creates a Web application deployment descriptor web.xml under the WEB-INF node .
  • Creates an index.jsp file that will be the home page of your application and stores it below the web node.
  • Configures a basic artifact of the type exploded with the following structure:
    basic_artifact_configuration.png

    You can use this configuration as is or customize it, as required, for example, include static Web content resources.

To enable Web 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.

To enable Web development support for an existing module

  1. Open the Project tool window (e.g. View | Tool Windows | Project ).
  2. Right-click the module of interest 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.

To configure Web facet settings

  1. Open your Web facet settings. For corresponding instructions, see Changing Facet Settings.
  2. 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 edit1 (Enter).
  3. To assign another existing descriptor, click delete (Alt+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 add (Alt+Insert) and select the desired version and file in the Deployment Descriptor Location dialog box that opens.
  4. If your application server needs a proprietary deployment descriptor, click the Add Application Server Specific Descriptor button and select your server from the list.

See Also

Last modified: 12 November 2014
comments powered by Disqus