- Download Spring JAR Files http://repo.spring.io/release/org/springframework/spring/ Select the lastest release
- Copy all of the JAR files
- Paste to folder lib
- Download Apache Commons Logging Download https://commons.apache.org/proper/commons-logging/
- commons-logging-1.2.zip then copy the JAR file (commons-logging-1.2.jar) to your project in lib
- then Right-click >> Properties >> Java Build Path >> Add JARs.... >> select all of jar file and then OK
The approach of outsourcing the construction and managementof objects
create AppicationContext.xml
- Step 1 Configure your Spring Beans
<?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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<!-- load the properties file: sport.properties -->
<context:property-placeholder location="classpath:sports.properties" />
<!-- Define your beans here -->
<!--Step 1 -->
<bean id="myCoach" class="com.manit.spring.home.basic.TrackCoach">
<!-- set up constructor injection -->
<constructor-arg ref="myFortuneService" />
</bean>
</beans>