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 Android Security Essentials Live Lessons this week in the Android 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: 3476

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: 60810
    
  65

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
 
Similar Threads
Servlet Sessions Coding
Use Http And Https in Same application
Can I "cut" the chain in the filter?
Log4j in struts
Session Filter problem