Spring Example
Spring Example
java
@Override
public String toString() {
return this.personName + ":"+ this.personId +
":"+this.certi;
}
Certi.java
public Certi() {
super();
@Override
public String toString() {
return this.name;
}
App.java
import
org.springframework.context.ApplicationContext;
import
org.springframework.context.support.ClassPathXmlAppli
cationContext;
}}
Config.xml
xsi:schemaLocation="http://www.springframework.org/sc
hema/beans
http://www.springframework.org/schema/beans/spring-
beans.xsd">
<bean name="cer"
class="com.spring.constructor.Certi" c:name="java
full stack">
</bean>
<bean name="per"
class="com.spring.constructor.Person">
<!-- <constructor-arg>
<value>Ram</value>
</constructor-arg>
<constructor-arg>
<value>1234</value>
</constructor-arg>-->
<constructor-arg value="Shyam"/>
<constructor-arg value="101" type="int"/>
<constructor-arg ref="cer"/>
</bean>
</beans>