On page 860 of Head First 2nd edition , it says that "if nothing else,doFilter() must invoke chain.doFilter()."
But on page 733, the book also says chain.doFilter() is not mandatory.
So what's the correct answer?
Houston Rockets go go go!
posted 8 years ago
You must return chain.doFilter(req,resp) if you want to proccess the request, but if you don not want to continue proccesing because you have detected request is invalidad (or something like this), you do not call chain.doFilter(). You can use response object to send error, write html, etc... without calling chain.doFilter().