This is my first post on Servlets and Jsp.
Planning to take my certification at the end of next month.
I was reading the Servlet 3.0 Specification on Filters.
The following extract has been taken from the Servlet 3.0 Speficiation Among the types of functionality available to the developer needing to use filters are
■ The accessing of a resource before a request to it is invoked.
Could someone please explain what the above means
to access a resource before a request to it is invoked
I was of the assumption that we would modify the request, response or header data using filters.
The request before it reaches the resource or response after the call comes back from the resource
or the header information either before the request reaches the resource or when response is on its way back from the resource.
So I am a bit confused as to what the above sentence means.
Thanks in advance.
posted 7 years ago
Is it that the container first checks whether the resource is present and if the resource is not present then it will not invoke the filter on the particular resource.
So for this the container first needs to check whether the resource is present.
So is this what is meant by the following statement
The accessing of a resource before a request to it is invoked.
i think that suppose you have a resource(static or dynamic). to make it clear lets say the resource is a jar file or something. now with filter before you request this resource(jar file) you can access it using FilterConfig.getServletContext.getResource(String). the specs talk about resource so resource means any servlet, jsp, html .
posted 7 years ago
Thanks for the reply.
Ok now I see the actual meaning of it.
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!