If a servlet needs to log application-wide events, which object would be the best choice for retrieving the log file’s path?
- HttpServletRequest
- HttpServletResponse
- ServletConfig
- ServletContext
The ServletContext provides a way to retrieve information that is shared among servlets, making it suitable for obtaining the log file's path for application-wide event logging.
Loading...
Related Quiz
- _________ is a caching technique where frequently and recently accessed data is prioritized for caching.
- How does a servlet container differentiate between authenticated and unauthenticated users?
- In a complex web application using MVC and servlets, a new feature requires integration of a third-party service. Where should this integration primarily take place?
- A high-traffic website uses a cache that frequently encounters 'cache churn'. What strategy can be used to minimize this effect?
- What is the difference between filter chaining and servlet chaining?