I have a doubt whether a servletconfig object for a particular servlet is different for each request or same for each request.
siddharth das wrote:I think we cannot get the reference of servletconfig object from request object.
So, if you don't get a reference to a ServletConfig instance on every request, does your question still make sense?
The servletconfig object is instaciated by the container and pass to the init() when first request come..
Sort of. The servlet is guaranteed to be initialized before the the service method is called for the first time, but the container doesn't necessarily have to wait until a request comes in.
siddharth das wrote:Does the data present in servletContext object share through multiple requests?
There is only one ServletContext instance per web application.
siddharth das wrote:Ya, that I know.
If we store some data in servletcontext object in first request.Will that data can be accessed in 2nd request.
Your first statement answers the second.
Besides, seems easy enough to try it out. What happens when you test it?