๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Spring/Spring Quick Start

์ปฌ๋ ‰์…˜ ๊ฐ์ฒด ์„ค์ • ์ข…๋ฅ˜

  • java.util.List

<bean id="๋นˆ ์•„์ด๋””" class="ํด๋ž˜์Šค ์ฃผ์†Œ">
	<property name="_____"> <!-- set_____() ํ˜ธ์ถœ -->
		<list>
			<value>๋ฆฌ์ŠคํŠธ1</value>
			<value>๋ฆฌ์ŠคํŠธ2</value>
		</list>
	</property>
</bean>
  • java.util.Set: ์ค‘๋ณต๊ฐ’์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š๋Š” ์ง‘ํ•ฉ ๊ฐ์ฒด

<bean id="๋นˆ ์•„์ด๋””" class="ํด๋ž˜์Šค ์ฃผ์†Œ"> 
	<property name="๋ฉ”์†Œ๋“œ์ด๋ฆ„">
		<set value-type="java.lang.String">
			<value> Lovegame </value>
			<value> 0415 </value>
			<value> I'm in love </value>
		</set>
	</property>
</bean>
  • java.util.Map: ํŠน์ • key๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๋“ฑ๋กํ•˜๊ณ  ์‚ฌ์šฉ

<bean id="๋นˆ ์•„์ด๋””" class="ํด๋ž˜์Šค ์ฃผ์†Œ">
	<property name="๋ฉ”์†Œ๋“œ์ด๋ฆ„">
		<map>
			<entry>
				<key><value>์•„์ด์œ </value></key>
				<value> ๋ถ„ํ™์‹  </value>
			</entry>
			<entry>
				<key><value>์—”์‹œํ‹ฐ</value></key>
				<value> BOSS </value>
			</entry>
		</map>
		</property>
</bean>
  • java.util.Properties: key-value ํ˜•ํƒœ์˜ ๋ฐ์ดํ„ฐ

<bean id="๋นˆ ์•„์ด๋””" class="ํด๋ž˜์Šค ์ฃผ์†Œ">
	<property name="๋ฉ”์†Œ๋“œ ์ด๋ฆ„">
		<props>
			<prop key="์˜ค๋Š˜">2020.12.30</prop>
			<prop key="๋‚ด์ผ">2020๋…„ ๋Œ๋ ค๋‚ด</prop>
		</props>
	</property>
</bean>