In Spring, explain the significance of init-method and destroy-method attributes on a bean?

Answered

In Spring, explain the significance of init-method and destroy-method attributes on a bean?

Ninja Asked on 17th September 2018 in Spring.
Add Comment
1 Answer(s)
Best answer

The init-method and destroy-method can be used to provide custom code that will be invoked by the Spring container. The init-method is invoked immediately after the bean is initialized and the destroy-method is invoked before the bean is removed from the container.

Ninja Answered on 17th September 2018.
Add Comment