Notice
Recent Posts
Recent Comments
Link
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Tags more
Archives
Today
Total
관리 메뉴

Shinu_o

[Spring] 스프링 xml 설정 기본 골격 본문

IT 관련 지식/프레임워크

[Spring] 스프링 xml 설정 기본 골격

Shinu_o 2020. 10. 1. 15:10

xml 파일로 DI 설정은

아래와 같은 골격으로 진행한다

 

<bean id="빈 식별자" class="생성할 객체의 완전한 클래스 이름">
	<property name="프로퍼티 이름">
		<value>프로퍼티 값</value>
	</property>
	<property name="프로퍼티 이름" ref="다른 빈 식별자" />
</bean>

<bean id="빈식별자" class="생성할 객체의 완전한 클래스 이름">
	<constructor-arg><value>인자값</value></constructor-arg>
	<constructor-arg><ref bean="다른 빈 식별자" /></constructor-arg>
</bean>

 

Comments