Container-level default-init-method and default-destroy-method

You can even set container-level default init and destroy methods so that you don't need to set it for each bean. The container invokes these methods on beans only if they are present:

<beans default-init-method="init" default-destroy-method="cleanup">
...
</beans>

Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.