File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt regarding filters. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt regarding filters." Watch "Doubt regarding filters." New topic

Doubt regarding filters.

Gaurav Sahni
Ranch Hand

Joined: Sep 03, 2003
Posts: 56

In the SCWCD study kit by Hanumant Deshmukh (Manning Publications), on p.395 under the section " Important points to remember about filters" , there is a point saying,

" Filter associated with a resource are not executed when a request is sent to the resource through a RequestDispatcher. This is done in order to prevent a filter calling itself and thus entering into a livelock. "

what does this means ?
Can anybody explain, what the author is trying to say ?


To know recursion, you must first know recursion...
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Think about the mess. You have one servlet (S) in your application, which maps through filter (F). Filter F does nothing more than dispatch the request on to S, which then goes to F which dispatches to F, which goes to F, which dispatches to F, which goes to F. On and on. There is the possibility that the request will never be handled, and worse--the server would be consumed with pointless CPU computations. Fun, huh?

I agree. Here's the link:
subject: Doubt regarding filters.
It's not a secret anymore!