If an application needs to clean up resources when the application is shut down, which listener should be used?
- HttpSessionListener
- ServletContextAttributeListener
- ServletContextListener
- ServletRequestListener
The ServletContextListener is used to perform actions during the initialization and destruction of the web application, making it suitable for cleaning up resources on application shutdown.
Loading...
Related Quiz
- What are the security concerns to consider while implementing file upload in servlets?
- In a distributed system, when two databases must be updated as part of a single transaction, which transaction management technique is most appropriate?
- A servlet is configured with specific initialization parameters. How does this impact the servlet's processing of requests?
- A servlet handling massive data queries is experiencing performance issues. What optimization technique should be prioritized?
- In an advanced MVC framework, how is the decision made in a servlet to select a specific view based on business logic?