wood burning stoves 2.0*
The moose likes Servlets and the fly likes Unsure about this filter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Unsure about this filter" Watch "Unsure about this filter" New topic
Author

Unsure about this filter

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hi.
I have been reading LinkTrackerFilter class from "Servlets and JavaServer Pages� The J2EE� Technology Web Tier" book's source and some questions arised.
This class extracts a url from the query string then redirects the request to that url and then return statement appears.
At the end of the class, the code increases a static counter then there is a chain.doFilter( ).
The book emphases that the calling to the previous doFilter is important in order to allow other filters, servlets and JSP to handle the request.
Since the code the freely avaible, I will post some snipets here :

How the hell the last two lines would be getting called ? there is a return statement !
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Did you look closely at the code? Is the return statement unconditionally always reached?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unsure about this filter