Originally posted by Srikanth Raghavan:
Thanks Narendra! But will the Servlet be called? (If there's a matching Servlet/JSP is found for that URL pattern) Sounds like a stupid question and I guess it will, am I right?
-- Srikanth
Hi,
The FilterChain is built if the matching resource(Servlet/JSP) is found. If you do not call the doFilter method in the filter doFilter method, it means that you want to stop the processing and do not want to process the next filter or servlet or
JSP. For example, you are writing the Security filter and do not want to process the Servlet/JSP if the user is not authenticated, then you can terminate the processing of request in the filter itself by not calling the FilterChain.doFilter method.
Hope this help
Thaks
Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0