Sunday, June 20, 2010

Difference between ServletConfig and ServletContext ?

when we deploy a web application the webcontainer reads the deployment descriptor(i.e,web.xml).If there is no problem then the webcontainer creates a ServletContext object for that web-application.the webcontainer removes the ServletContext objcet when the web application is stopped.so the no. of ServletContext objects present in web container depends on no.of web applications present in web.xml.for every web application a ServletContext object is created by web container.


and WebContainer creatse ServletConfig object for every servlet that is a part of web application.As part of web application there will be only one ServletContext object,but there can be multiple ServletConfig objects...

No comments:

Post a Comment