filter-config_1_0.dtd Documentation

The filter.xml file contains configuration information for filters. It is used for configuring filters in Servlet 2.2 web containers and for org.chwf.servlet.filter.CompositeFilter subclasses.

Attributes whose names are in italics are optional.

Tag Summary
description A description of the filter.
filter Declares a filter in the web application.
filter-class The fully qualified classname of the filter.
filter-name The logical name of the filter.
init-param The init-param element contains a name/value pair as an initialization param of the filter.
mapped-extension The mapped extension (for URLs exposed to the client).
param-name The param-name element contains the name of a parameter.
param-value The param-value element contains the value of a parameter.
resource-extension The resource extension (the extension used by the servlet engine).
resource-mapping <p>Declares a mapped extension for a given resource extension.
url-pattern The url-pattern element contains the url pattern of the mapping.
web-app The root tag for filter.

web-app

The root tag for filter.xml.

Content: (filter*, resource-mapping*)

filter

Declares a filter in the web application. The filter is mapped to a URL pattern. Filters can access the initialization parameters declare in the deployment descriptor at runtime via the FilterConfig interface.

Used in: web-app

Content: (filter-name, description?, filter-class, init-param*, url-pattern+)

filter-name

The logical name of the filter. This name is used to map the filter. Each filter name is unique within the web application.

Used in: filter

Content: Text

description

A description of the filter.

Used in: filter

Content: Text

filter-class

The fully qualified classname of the filter.

Used in: filter

Content: Text

init-param

The init-param element contains a name/value pair as an initialization param of the filter.

Used in: filter

Content: (param-name, param-value)

param-name

The param-name element contains the name of a parameter.

Used in: init-param

Content: Text

param-value

The param-value element contains the value of a parameter.

Used in: init-param

Content: Text

url-pattern

The url-pattern element contains the url pattern of the mapping. Must follow the rules specified in the Servlet API Specification. In particular, patterns can be:

  • Exact matches, relative to the context root, beginning with "/" [/page.jsp].
  • Wildcard patterns ending with "*" and beginning with "/" [/directory/*].
  • Wildcard patterns beginning with "*" and ending with a file extension [*.vm]
  • The pattern "*" or "/*", which matches everything.

Filters within a CompositeFilter should not have a URL pattern; they use the pattern of the CompositeFilter.

Used in: filter

Content: Text

resource-mapping

Declares a mapped extension for a given resource extension. Client URLs should use the mapped extension; the filter chain will convert this mapped extension to the resource extension when invoking the resource at the end of the filter chain. The URL pattern for the FilterServlet should include all mapped extensions.

For example, the default configuration for Chrysalis maps the ".view" extension to ".jsp" files. The client URL "showData.view" would invoke the "showData.jsp" page if Chrysalis is running in a Servlet 2.2 container.

The resource mapping is not used for a CompositeFilter.

Used in: web-app

Content: (mapped-extension, resource-extension)

mapped-extension

The mapped extension (for URLs exposed to the client). For example: "*.view"

Used in: resource-mapping

Content: Text

resource-extension

The resource extension (the extension used by the servlet engine). For example: "*.jsp"

Used in: resource-mapping

Content: Text