dimanche 8 mars 2015

What is initialization method in Spring?

I am studying for the Spring Core certification and I have the following dount on this question:



What is an initialization method and how is it declared in a Spring bean?



My doubt is: is it this question refered to the @PostConstruct annotation (in case of annotation based config) or the init-method attribute (in case of the XML configuration), so something like this:



@PostConstruct
public void setup() {
...
}


and



<bean id=“accountService” class=“com.acme.ServiceImpl” init-method=“setup”>
...
</bean>


Or is it refered to something else that now I am missing?


Aucun commentaire:

Enregistrer un commentaire