KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
SampleBean: package com.springexample; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; public class SampleBean { private BeanTypeOne beanOne; private BeanTypeTwo beanTwo; public void init() { System.out.println("This is from the init() method"); } @PostConstruct public void initAnnotation() { System.out.println("This is from the initAnnotation() method"); } and config file like this : <bean id="SampleBean" class="com.springexample.SampleBean"> <property name="beanOne" ref="beanOneOne"></property> <property name="beanTwo" ref="beanTwoOne"></property> </bean> And I don't have default-init-method attribute set on the beans tag. Can any body tell why the @PostConstruct method does not get called.
Tags (comma-separated)
Save Edits
Cancel