首页 > 编程语言 > 详细

Spring笔记

时间:2016-02-15 21:16:29      阅读:239      评论:0      收藏:0      [点我收藏+]

1、安装Spring Tool Sui

登录http://spring.io/tools/sts/all 下载所需的Spring Tool Suit安装包

下载完成后

Eclipse --- Help--- Install new Sofware

点击Add按钮 ,再点击Archive 选择你刚刚下载的zip文件

选择带有“Spring IDE”字样的项,一个4个:

技术分享

最好取消联网更新,否则会很慢

技术分享

2、加Maven

参考http://projects.spring.io/spring-framework/

<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>4.2.4.RELEASE</version>
    </dependency>
</dependencies>

 3、范例

src下新建Spring Bean Configuration File,命名applicationContext.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 -->
    <bean id="helloWorld" class="com.mycompany.app.my_webapp.HelloWorld">
    <property name="name" value="Colin2"></property>
    </bean>
</beans>

 

Spring笔记

原文:http://www.cnblogs.com/sysout/p/5191313.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!