In which method of a servlet are most of the resources like threads, database connections, etc., released?
- destroy()
- doGet()
- init()
- service()
The destroy() method is called when a servlet is being removed from service, and it is used to release resources like threads and database connections.
Loading...
Related Quiz
- What mechanism is used to chain multiple filters together in a web application?
- When handling a file upload, if an IOException occurs, how should the servlet respond and log the event?
- Which HTTP method is idempotent: GET or POST?
- The __________ method in servlets is often used to dispatch requests to different handlers in an MVC framework.
- What is a common practice to reduce the load on a servlet?