• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt regarding filters.

 
Gaurav Sahni
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings...

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 ?

Gaurav.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic