I have a Handler object that functions kind of like a service. It has a public init method defined in the Implementation but not the Interface. This Handler is also being autowired via Spring. How does the init method get invoked? Is it via Spring or does Tomcat call this?
Share
If it’s spring, an
init-methodattribute should do the trick. Similarly, one can implement theInitializingBean#afterPropertiesSetmethod in which theinitcould be invoked.If you don’t see an
init-methodattribute being specified for your bean declaration in spring, look for adefault-init-method="init"attribute declaration in the root tag,beans.