Hi Rahman
Check this one for your reference
servlet context is used if you want some values which must exist for the life time of the application. A servlet config object used by a servlet container to pass information to a servlet during initialization.The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized.
1)
Parameters defined in the ServletContext are visible for all servlets
Where as parameters defined in the ServletConfig are visible to the servlet where it has been defined .
2)
ServletContext has application scope wide
where as ServletConfig has Servlet scope
ServletContext has a life time as that of container.,
Only one time we can modify the servlet information by ServletConfig while Servlet(Server) loaded or initiated. But by ServletContext we can modify the information when we need at any tme in the whole application of the program.