Right answer. ServletConfig is read only object. All of its properties are set by JSP/Servlet container. Access of multipal threads have no harm to Servlet Config.
Joined: Jan 11, 2011
So when we have a situation like this:
" Many requests are coming in for a given sevlet A.
So the container would create threads of that servlet(A) for each request.
Now each of this thread would have a servlet config."
Now, would all the threads be having the same servlet config i.e will the container create only one servlet config for a servlet instance(for A in our case)and pass its copy to its threads?
Or will it create a servlet config for each of the thread?
There is only one instance of the servlet and hence one instance of ServletConfig.
The threads that process the requests call the service() method of the Servlet which has one single instance.
The thread and the instance are two separate thing.
Hope this help you to clarify your understanding about the same.