Servlet config object represent single servlet.
Its like local parameter associated with particular servlet.
It’s a name value pair defined inside the servlet section of web.xml file so it has servlet wide scope.
getServletConfig() method is used to get the config object.
for example shopping cart of a user is a specific to particular user so here we can use servlet config.
It represent whole web application running on particular JVM and common for all the servlet.
Its like global parameter associated with whole application.
ServletContext has application wide scope so define outside of servlet tag in web.xml file.
getServletContext() method is used to get the context object.
To get the MIME type of a file or application session related information is stored using servlet context object.