The first way is to use <props>
tag as below.
<bean id="adminUser" class="com.freetimelearn.common.Customer">
<!-- java.util.Properties -->
<property name="emails">
<props>
<prop key="admin">admin@nospam.com</prop>
<prop key="support">support@nospam.com</prop>
</props>
</property>
</bean>
You can use the “util:” namespace as well to create properties bean from a properties file and use bean reference for setter injection.
<util:properties id="emails" location="classpath:com/foo/emails.properties" />