blob: 25bf23c918a702e7bd7765d0cfa8e082f8f6e438 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<?NLS type="org.eclipse.help.contexts"?>
<contexts>
<context id="fltw1050">
<description>
A filter is used to give you access to the HttpServletRequest and the HttpServletResponse objects before they are passed into a servlet.
Specify the <b>Project</b> and <b>Folder</b> where the filter class will be placed. The filter class should be stored in the Java source directory, which you specified when you created the Dynamic Web Project (for example src).
Specify the <b>Java package</b> that the class will belong to. If you do not specify one, the class will be added into a default package.
Specify the <b>Class name</b> of the filter (for example MyFilter).
In the field <b>Superclass</b> specify the superclass for the filter,only if it is derived from one. Click <b>Browse</b> to choose from the available, already existing or created, superclasses. (This field is optional).
Check <b>Use existing Filter class</b> and you could get an already existing class and it will be registered automatically in your web.xml.
Note: If you have selected the XDoclet facet when creating the Dynamic Web Project, you can now select <b>Generate a XDoclet annotated class</b>. This will create a XDoclet annotated filter class. The annotations will generate the metadata in the web.xml deployment descriptor.
</description>
<topic label="Creating Filters" href="../org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html"/>
</context>
<context id="fltw1100">
<description>
Note that the Class Name value provided in the first page of the wizard is automatically mapped to the <b>Name</b> field on this page.
Specify the <b>Initialization Parameters</b> of the filter as name/value pairs (for example passwords).
In the <b>Filter Mappings</b> field, specify the Servlet, to which the filter will be mapped. Do this by clicking the <b>Add</b> button. In the <b>Add filter mapping</b> dialog that appears after you click the <b>Add</b> button, if you select the <b>Servlet</b> radio button you can choose an existing servlet class, but if you select the <b>URL Pattern</b> radio button you have to enter the URL pattern to which you want to map the filter. In the same dialog, but from <b>Select Dispatchers</b> group, you can choose which dispatchers to be invoked in the deployment descriptor. The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE, and ERROR.
<b>-</b> A value of <b>FORWARD</b> means the Filter will be applied under <b>RequestDispatcher.forward()</b> calls.
<b>-</b> A value of <b>REQUEST</b> means the Filter will be applied under ordinary client calls to the <b>path</b> or <b>servlet</b>.
<b>-</b> A value of <b>INCLUDE</b> means the Filter will be applied under <b>RequestDispatcher.include()</b> calls.
<b>-</b> A value of <b>ERROR</b> means the Filter will be applied under the error page mechanism.
<b>-</b> If no despatcher is selected, it indicates that filters will be applied only under ordinary client calls to the <b>path</b> or <b>servlet</b>.
</description>
<topic label="Creating Filters" href="../org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html"/>
</context>
<context id="fltw1200">
<description>
Note that the Sun Microsystems Java Servlet Specification states that a Servlet class must be <b>public</b> and not <b>abstract</b>. Therefore, you cannot change these modifiers. The only one available for change is the <b>final</b> modifier.
A filter class must implement the Filter interface, that's why the <b>javax.servlet.Filter</b> is provided as the default Interface. You can also add additional interfaces to implement. Click <b>Add</b> to open the <b>Interface Selection</b> dialog. In this dialog, as you type the name of the interface that you are interested to add, there will be displayed only the interfaces that match the pattern.
Note: Because the methods init, doFilter and destroy are provided from javax.servlet.Filter interface and this interface is obligatory for each Filter class, the option <b>Inherited abstract methods</b> is always checked and can't be changed.
Using the option <b>Constructors from superclass</b> you can choose whether to override the constructor of the class, which you specified as superclass in the first page of the wizard. Note: If you did not specify any class as superclass, you can not check this option.
</description>
<topic label="Creating Filters" href="../org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html"/>
</context>
</contexts>