develog

[Spring] beans.xml 설정2, annotation-config 본문

Dev/Spring

[Spring] beans.xml 설정2, annotation-config

냐옴 2015. 8. 28. 11:02

spring-config.xml

<beans>
    <context:annotation-config/>
    <bean id="myService" class="com.my.service.MyService"/>
    <bean id="myDao" class="com.my.dao.MyDao"/>
</beans>

MyService.java

package com.my.service;

public class MyService {
    @Autowired
    private MyDao myDao;
}

MyDao.java

package com.my.dao;

public class MyDao {
}

'Dev > Spring' 카테고리의 다른 글

[Spring] spring cron expression test  (0) 2019.06.21
[Spring] beans.xml 설정3, component-scan  (0) 2015.08.28
[Spring] beans.xml 설정1, 기본  (0) 2015.08.28
[Spring] beans.xml  (0) 2015.06.04
[Spring] Spring3 AOP 설정, xml or java  (0) 2015.06.04
Comments