Eclipse安装springsource-tool-suite插件及spring helloworld入门实例
转载至:
https://www.cnblogs.com/aaron-shu/p/5156007.html
一、查看eclipse版本
Help-->About Eclipse,我的版本是4.4.2。
二、根据eclipse 版本,选择插件版本
访问网址:http://spring.io/tools/sts/all 查看eclipse对应的插件版本
eclipsep安装spring插件有两种方式:在线安装和本地安装;
1、在线安装
Help-->Install New Software-->work with 中输入http://dist.springsource.com/release/TOOLS/update/e4.4/ ,回车等待片刻,选中带spring IDE的四项,一直next直到完成,重启eclipse。
2、本地安装
Help-->Install New Software-->Add-->Local-->选择解压文件夹,剩下的和在线安装类似。
三、下载spring jar包
访问http://projects.spring.io/spring-framework/,可以看到最新的稳定版本为4.2.4
点击Reference-->点击Distribution Zip Files-->点击http://repo.spring.io/release/org/springframework/spring
选择最新的稳定版本4.2.4.RELEASE
打开页面,根据提示下载需要的文件
四、HelloWorld入门实例
1、新建java工程,命名HelloSpring;新建Folder 命名为lib,存放Spring基本的jar包和commons-logging包(可在Struts的lib中找到),并将这些包Add Build Path。项目结构图所下图所示:
2、HelloWorld.java代码

package com.ke361; public class HelloWorld {
private String message;
public void setMessage(String message){
this.message=message;
}
public void getMessage(){
System.out.println("Your Message : " + message);
}
}

3、新建spring配置文件
在src下新建spring配置文件,命名为applicationContext.xml。
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 id="helloWorld" class="com.ke361.HelloWorld">
<property name="message" value="Hello World!"/>
</bean>
</beans>

4、MainApp.java代码

package com.ke361;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class MainApp { public static void main(String[] args) {
// TODO Auto-generated method stub
ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
HelloWorld obj=(HelloWorld)context.getBean("helloWorld");
obj.getMessage();
} }

5、运行结果
Eclipse安装springsource-tool-suite插件及spring helloworld入门实例的更多相关文章
- eclipse4.6.1安装SpringSource Tool Suite(sts-eclipse)插件
1. Spring Tool Suite(sts)简介 Spring Tool Suite(sts)就是一个基于Eclipse的开发环境, 用于开发Spring应用程序.它提供了一个现成的使用环境来实 ...
- 用spring tool suite插件创建spring boot项目时报An internal error occurred during: "Building UI model". com/google/common/
本文为博主原创,未经允许不得转载 在用spring tool suite创建spring boot项目时,报一下异常: 查阅很多资料之后发现是因为装的spring tool suite的版本与ecli ...
- 图解Eclipse或者SpringSource Tool Suite 创建模块化Maven项目
第一步:Package Explorer里选择右键,新建Maven项目,如果没有在Other里找,还没有确认一下是否安装了Maven插件 第二步:在Wizards向导里可以通过搜索,找到Maven P ...
- eclipse 中安装spring tool suite 插件100%成功率
自己曾在学习spring时,在eclipse EE中安装springsourceTool Suite插件浪费了很多时间,不管是离线,在线还是在eclipse marketplace中安装,尝试了许多方 ...
- Eclipse Spring Tool Suite插件安装
目录 Eclipse Spring Tool Suite插件安装 Eclipse Spring Tool Suite插件安装 1.登录网址:http://spring.io/tools/sts/all ...
- 【Eclipse】Spring Tool Suite插件
Spring Tool Suite插件 最新下载地址:https://spring.io/tools3/sts/all 以前下载地址:https://spring.io/tools3/sts/lega ...
- myeclipse和eclipse安装Java反编译插件
为myeclipse和eclipse安装Java反编译插件 插件所需包 1.解压jad1.5.8g.zip.将jad.exe放到jre的bin目录下,下载地址: http://ishare.ia ...
- [原]Eclipse 安装SVN、Maven插件(补充)
参考雨之殇的文章:Eclipse 安装SVN.Maven插件 1.SVN可以按文章介绍的正常安装 2.Maven的Eclipse插件地址有变化 文章中的安装链接已经失效:m2e - http://m2 ...
- Eclipse 安装mybatis的编辑插件
1.MyEditor安装的方式 Eclipse 安装mybatis的编辑插件有以下4种方式,您可以使用下列方法之一来安装MyBatis的编辑器: Eclipse 3.7的(市场客户机安装):此图像拖放 ...
随机推荐
- vue项目中如何使用less
首先你的vue-cli下载完成 第一步 安装less-loader 依赖 npm install less less-loader --save-dev 直接自动就配置上了,不用手动配置 ...
- C++编程题#1:含k个3的数
描述 输入二个正整数m 和 k,其中1 < m < 100000,1 < k <5 ,判断m 能否被19整除,且恰好含有k个3,如果满足条件,则输出YES,否则,输出NO. 例 ...
- Linux查看服务器配置
服务器型号 [root@txs ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Produ ...
- 初学node遇到的问题(慢慢补充)
一.看到菜鸟教程的Web模块运行client.js的时候遇到报错: E:\node\server>node client.js events.js:72throw er; // Unhandle ...
- jQuery-3.事件篇---事件对象的使用
jQuery事件对象的作用 事件中的Event对象容易被初学者忽略掉,可能大多时候初学者不知道怎么去用它,但有些时候它还是非常有用的 一个标准的"click"点击事件 $(elem ...
- SQL动态长度行列转置
一,案列问题描述: 某销售系统中,注册的用户会在随后的月份中购物下单,需要按月统计注册的用户中各个月下单的金额.源数据表如下: FM::注册月份,CM: 下单月份, AMT:下单金额 期望得到如下统计 ...
- vue 新建项目
1. 首先安装node.js,安装时一直点Next,知道Finish就可以安装成功 2. 打开控制命令执行程序cmd,输入node -v ,可以查看node的版本信息,即安装成功,我安装的是v8.12 ...
- svg常见形状
SVG是使用XML来描述二维图形和绘图程序的语言.是指可伸缩矢量图形(Scalable Vector Graphics),svg.图像在放大或改变尺寸的情况下图形质量不会有所损失. svg的主要竞争者 ...
- asp.net实现伪静态
一.配置应用程序 1.下载URLRewrite.dll,程序中添加引用 2.在web.config中配置 <configuration> <configSections> &l ...
- node.js同步读取与异步读取文件