Register now or log in to join your professional community.
Hello ,
ServletContext object give you reference over all the application -context- , but servletConfig object give you reference on only one servlet.
For example you can use ServletContext to get the context initial parameters , and use servletConfig to get the servlet initial parameters.
note that there is only one servletConfig object avaliable to any servlet.
There is many other uses to both types of objects , you can getRequestDispatcher from servletContext , and you can log to the server using servletConfig ,.....