The following app-context.xml [sourcecode language=”xml”] <?xml version=”1.0″ encoding=”UTF-8″?> <beans xmlns=”http://www.springframework.org/schema/beans” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:context=”http://www.springframework.org/schema/context” xmlns:p=”http://www.springframework.org/schema/p” xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd”> <context:annotation-config/> <bean id=”profile” class=”com.skills421.spring15.beans.Profile”/> <bean id=”student1″ class=”com.skills421.spring15.beans.Student” p:name=”John Doe” p:age=”21″/> <bean id=”student2″ class=”com.skills421.spring15.beans.Student” p:name=”Jane Doe” p:age=”19″/> </beans> [/sourcecode] can be replaced with the …
XML based config file Annotation-based configuration Java-based configuration XML based config file [sourcecode language=”xml”] <!–?xml version=”1.0″ encoding=”UTF-8″?–> <!– A simple bean definition –> <!– collaborators and configuration for this bean go here –> <!– A bean definition with lazy init …