So, you will probably make use of the Servlet-
Request that is supplied as the first argument to doFilter. This object is frequently
typecast to HttpServletRequest to provide access to the more
specialized methods of that class.
Call the doFilter Method
of the FilterChain Object
The doFilter method of the Filter interface takes a FilterChain object as its
third argument. When you call the doFilter method of that object, the next associated
filter is invoked. This process normally continues until the last filter in the chain
is invoked. When the final filter calls the doFilter method of its FilterChain
object, the servlet or page itself is invoked.
However, any filter in the chain can interrupt the process by omitting the call to
the doFilter method of its FilterChain. In such a case, the servlet or JSP page
is never invoked and the filter is responsible for providing output to the client. For
details, see Section 5.7 (Blocking the Response).
5.1 Creating Basic Filters 207
Register the Filter with the
Appropriate Servlets and JSP Pages
The deployment descriptor provides two elements for use with filters: filter and
filter-mapping. The filter element registers a filtering object with the system.
The filter-mapping element specifies the URLs to which the filtering
object applies.
The filter Element
The filter element contains six possible subelements:
??? icon. This is an optional element that declares an image file that an
IDE can use.
Pages:
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256