views:

23

answers:

1

Hey,

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?

+2  A: 

If it's spring, an init-method attribute should do the trick. Similarly, one can implement the InitializingBean#afterPropertiesSet method in which the init could be invoked.

If you don't see an init-method attribute being specified for your bean declaration in spring, look for a default-init-method="init" attribute declaration in the root tag, beans.

Adarsh R
sweet thanks Adarsh!
stevebot