There’s only one ServletContext for an entire web app, and all the parts of the web app share it. But each servlet in the app has its own ServletConfig. The Container makes a ServletContext when a web app is deployed, and makes the context available to each Servlet and JSP (which becomes a servlet) in the web app.
Web app initialization:
Container reads the DD and creates a name/value String pair for each <context-param>.
Container creates a new instance of ServletContext.
Container gives the ServletContext a reference to each name/value pair of the context init parameters.
Every servlet and JSP deployed as part of a single web app has access to that same ServletContext.
Don’t confuse ServletConfig parameters with ServletContext parameters!
You really have to keep these straight on the exam, and it’s tricky. You MUST know that both ServletConfig and ServletContext have init parameters, and both have the same getter method—getInitParameter(). BUT... you also have to know that context init parameters are set with <context-param> (not inside a <servlet> element) while servlet init parameters use <init-param> inside the individual <servlet> declarations in the DD.
If the app is distributed, there’s one ServletContext per JVM!
If your application is distributed across multiple servers (probably in a clustered environment), ...