Skip to content

Commit

Permalink
Spring di file added.
Browse files Browse the repository at this point in the history
  • Loading branch information
yrojha4ever committed Jan 10, 2016
1 parent e998146 commit 90634e3
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions SpringDependInjection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'''
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean autowire="byName" class="di.constructorInjection.User" id="user">
<constructor-arg value="Buddha"/>
<constructor-arg value="30"/>
<constructor-arg value="Nepal"/>
<constructor-arg>
<list>
<value>Kathmandu</value>
<value>Dhangadi</value>
<value>Mahendranagar</value>
</list>
</constructor-arg>
</bean>


<bean class="di.setterInjection.Address" id="address">
<property name="city" value="KTM"/>
<property name="state" value="STATE"/>
<property name="zip" value="0977"/>
<property name="country" value="NEPAL"/>
</bean>

<bean class="di.setterInjection.UserDto" id="userSetterInjection">
<property value="Buddha(Gautam)" name="name"/>
<property value="30" name="age"/>
<property name="address" ref="address"/>
</bean>

</beans>
'''

Make sure you have spring-beans framework is also in pom.xml file.
'''
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring-framework.version}</version>
</dependency>
'''

0 comments on commit 90634e3

Please sign in to comment.