Multiple choice technology

Number of ServletContext object present for an application is __________

  1. 2

  2. 1

  3. not fixed

  4. 3

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

There is exactly one ServletContext object per web application. It is created by the container when the application is deployed and shared by all servlets in that application. This singleton pattern ensures all servlets access the same application-wide configuration and attributes. The context is destroyed when the application is undeployed or the container shuts down.