Difference between ServletConfig and ServletContext in Java Servlet

Difference between ServletConfig and ServletContext in Java Servlet is popular question in java interview. Let see following are differences.

No. of web applications = That many number of ServletContext objects

No. of servlet classes = That many number of ServletConfig objects.

Usage of ServletContext Interface

There can be a lot of usage of ServletContext object. Some of them are as follows:

Popular Tutorials

Usage of ServletConfig Interface



Servlet Related Posts
  1. Java Servlets Overview
  2. Servlet Life Cycle
  3. Servlet Example
  4. Difference between GenericServlet and HttpServlet
  5. What is web application?
  6. Advantages of Servlets over CGI
  7. GenericServlet Example
  8. RequestDispatcher Example
  9. ServletConfig
  10. ServletContext
  11. Servlet Filter Example
  12. Database Access Example using Sevlet
  13. File Uploading Example using Servlet

Labels: ,