I encountered this question(true/false kind) on Marcus simulation exam where one option was
A filter can be invoked either through being declared in WEB.XML or explicitly within a programmers code.
I marked it true as in case of filter chaining we do invoke the other filter in chain by calling .
However I got the answer wrong. I am unable to comprehend that despite the fact that we give a call to the next filter in the filter chain, how is it that we can conclude that filter cannot be invoked through program.
But that call is to the FilterChain, not any particular filter. At that point you're merely handing control back over to the container. There might be another filter there, there might not. You don't know. Only the container controls it.