Adding a Filter to the Deployment Descriptor
See Also
You can add a filter to a web module deployment descriptor (web.xml)
in two ways:
- Using the New wizard when you create the filter.
On the Configure Filter Deployment page, select the Add Information to Deployment
Descriptor (web.xml) checkbox, type the filter's internal name, and add the
filter's mappings. Optionally, you can add the filter's initialization parameters
from the Filter Init Parameters page, which is the next step in the wizard.
- Editing the web module's deployment descriptor (web.xml).
The filter element in the deployment descriptor defines the filter. In the
filter element, you declare:
- filter-name. Maps the filter to a servlet or URL.
- filter-class. Identifies the filter class.
- init-params. Indicates the initialization parameters for the filter.
- dispatcher. Specifies whether to invoke the filter for forward requests,
include requests, error page requests, or a combination of these requests.
Optionally, you can also specify:
- Large and small icons
- A textual description
- A display name for tool manipulation
Filter mapping elements define the servlets and static resources to which the server
must apply the filter.
Legal Notices