IntelliJ IDEA 14.0.0 Web Help

Defining the Filter Mapping Element

You can map filters to a URL or a servlet name. When a filter is mapped to a URL, the filter applies to every servlet and JSP page in your Web application. When a filter is mapped to a servlet name, it applies to a single servlet or JSP.

IntelliJ IDEA provides the facilities to configure, edit, and remove Filter Mapping elements using the Web Module Editor window, Assembly Descriptor tab. The tab is synchronized with the Text tab where the web.xml code is generated based on the settings you specify.

To define a filter mapping

  1. Select the required filter in the Filters Configured pane, tab General, and switch to the Assembly Descriptor tab.
  2. In the Filter Mappings pane, click add. A new row appears with the Filter text box displaying the name of the selected filter.
  3. To define a URL-mapping, in the URL Pattern text box, type the URL pattern that associates the filter with the URLs that call the filter.

    A URL pattern may contain a subset of US-ASCII characters. Avoid using other values.

  4. To define a servlet-mapping, in the Servlet drop-down list select the relevant servlet.

To edit a filter mapping

  1. Select the required filter in the Filters Configured pane, tab General, and switch to the Assembly Descriptor tab.
  2. In the Filter Mappings pane, select the relevant row.
  3. Proceed as during mapping creation.

To remove a filter mapping

  • Select the relevant row and click delete.

See Also

Last modified: 12 November 2014
comments powered by Disqus