getServletContextgetInitParameterdatabaseurl
`getServletContext` is a method in Java’s Servlet API used to obtain a reference to the `ServletContext` object associated with a servlet. The `ServletContext` represents the web application in which the servlet is running and provides access to application-wide resources, configuration, and services.
The method is defined in the `Servlet` interface and is called on an instance of a servlet.
- Accessing initialization parameters defined in the deployment descriptor (e.g., `web.xml`) or annotations.
- Retrieving resources such as files or URLs (e.g., using `getResource()` or `getResourceAsStream()`).
- Managing sessions, listeners, and filters registered in the application.
- Accessing the application’s context path, real path, or virtual host information.
For example, a servlet might use `getServletContext()` to load configuration properties from a file or to forward
The `ServletContext` is a singleton per web application, meaning all servlets within the same application share