WHAT IS DIFFERENCE BETWEEN SERVLETCONFIG AND SERVLETCONTEXT?

Kamlakar Singh

Total Post:80

Points:400
Posted by  Kamlakar Singh
 784  View(s)
Ratings:
Rate this:
  1. Kamlakar Singh

    Post:80

    Points:400
    What is difference between ServletConfig and ServletContext?

    Some of the differences between ServletConfig and ServletContext are:

    • ServletConfig is a unique object per servlet whereas ServletContext is a unique object for complete application.
    • ServletConfig is used to provide init parameters to the servlet whereas ServletContext is used to provide application level init parameters that all other servlets can use.
    • We can’t set attributes in ServletConfig object whereas we can set attributes in ServletContext that other servlets can use in their implementation.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!