Spring 搭建

引jar包

    commons-logging-1.2.jar

  核心包
    spring-beans-3.2.16.RELEASE.jar
    spring-context-3.2.16.RELEASE.jar
    spring-core-3.2.16.RELEASE.jar
    spring-expression-3.2.16.RELEASE.jar

创建资源文件 

  SpringConfig.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"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="en" class="dao.User"> //实例化一个user对象  
  <property name="name">
  <value>hello word</value>
  </property>
  </bean>
</beans>

posted @ 2019-04-21 17:14  路过春天的雨点  阅读(97)  评论(0)    收藏  举报