一、快速准备

SSM 框架即 Spring 框架、SpringMVC 框架、MyBatis 框架,关于这几个框架的基础和入门程序,我前面已经写过几篇文章作为基础和入门介绍了。这里再简单的介绍一下:

1.Spring

Spring 框架是 Java 应用最广的框架,它的成功来源于理念,而不是技术本身,它的理念包括 IoC (控制反转) 和 A面向切面编程)。Spring框架是个轻量级的Java EE框架,所谓轻量级,是指不依赖于容器就能运行的。简单来说,Spring是一个轻量级的控制反转(IoC)和面向切面(AOP)的容器框架。

2.Spring MVC

作用于web层,相当于controller,与struts中的action一样,都是用来处理用户请求的。同时,相比于struts2来说,更加细粒度,它是基于方法层面的,而struts是基于类层面的。Spring MVC 分离了控制器、模型对象、分派器以及处理程序对象的角色,这种分离让它们更容易进行定制。

3.MyBatis

MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBatis 。MyBatis 是一款优秀的持久层框架,它支持定制化 SQL、存储过程以及高级映射。MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集。MyBatis 可以使用简单的 XML 或注解来配置和映射原生信息,将接口和 Java 的 POJOs(Plain Old Java Objects,普通的 Java对象)映射成数据库中的记录。

如果已经陆续学习过 SSM 框架相关知识的,可以忽略掉这一部分,直接看下面的内容。

二、快速创建项目

鉴于 jar 包依赖于管理的方便,我们使用 Maven 进行项目的管理和开发,所以这一步我们使用 IDEA 快速创建一个 Maven 项目,关于如何使用 IDEA 快速创建 Maven 项目,这里就不进行过多赘述了,大家可以参考下面这篇文章:

Maven 项目管理工具基础系列(一)

三、快速配置 jar 包依赖

Maven 项目创建完成后,快速打开并配置 pom.xml 文件,具体配置如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ssm.example</groupId>
<artifactId>SsmDemo</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>SSMDemo Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies> <!-- 配置 SpringMVC 依赖包 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.7.RELEASE</version>
</dependency> <!-- Spring JDBC 依赖包-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.7.RELEASE</version>
</dependency> <!-- Spring AOP 依赖包-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>4.3.7.RELEASE</version>
</dependency> <!--MyBatis 依赖包-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.2</version>
</dependency> <!-- Spring 整合 MyBatis 依赖包 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.1</version>
</dependency> <!-- MySQL 驱动依赖包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
</dependency> <!-- C3P0 数据源依赖包 -->
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1</version>
</dependency> <!-- jstl 依赖包 -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency> <!-- ServletAPI 依赖包-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency> <!-- junit 测试依赖包 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency> </dependencies> <!-- 如果不添加此节点,mybatis 的 mapper.xml 文件都会被漏掉 -->
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build> </project>

四、快速配置编码过滤和资源加载

打开 web.xml 文件,快速配置开启 Spring 、SpringMVC 编码过滤以及静态资源加载,具体配置代码如下:

<web-app>
<display-name>Archetype Created Web Application</display-name> <!-- 启动Spring的容器 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <!-- SpringMVC的前端控制器,拦截所有请求 -->
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
</servlet> <servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping> <!-- 字符编码过滤器,一定要放在所有过滤器之前 -->
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
<init-param>
<param-name>forceRequestEncoding</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>forceResponseEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <!-- 加载静态资源 -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping> <servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
</servlet-mapping> </web-app>

五、快速配置 Spring 配置文件

在 resources 文件夹下新建 applicationContext.xml 文件,配置 MyBatis 和数据库相关信息,具体代码配置如下:

<?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> <!-- 加载资源文件 -->
<context:property-placeholder location="classpath:db.properties"/> <!-- 配置 C3P0 数据源 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="user" value="${jdbc.user}"></property>
<property name="password" value="${jdbc.password}"></property>
<property name="driverClass" value="${jdbc.driverClass}"></property>
<property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property>
<property name="initialPoolSize" value="5"></property>
<property name="maxPoolSize" value="10"></property>
</bean> <!-- 配置 MyBatis SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 指定 MyBatis 数据源 -->
<property name="dataSource" ref="dataSource"/>
<!-- 指定 MyBatis mapper 映射文件位置 -->
<property name="mapperLocations" value="classpath:com/ssm/example/dao/*.xml"/>
<!-- 指定 MyBatis 全局配置文件的位置 -->
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
</bean> <!-- 扫描 MyBatis 的 mapper 接口 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!--扫描所有 dao 接口,加入到 IOC 容器中 -->
<property name="basePackage" value="com.ssm.example.dao"/>
</bean> <!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!-- 指定数据源 -->
<property name="dataSource" ref="dataSource"></property>
</bean> <!-- 配置事务增强 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 配置所有方法都是事务方法 -->
<tx:method name="*"/>
<tx:method name="get*" read-only="true"/>
</tx:attributes>
</tx:advice> <!-- 开启基于注解的事务 -->
<aop:config>
<!-- 切入点表达式 -->
<aop:pointcut expression="execution(* com.ssm.example.service.impl.*.*(..))" id="txPoint"/>
<!-- 配置事务增强 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/>
</aop:config>
</beans>

六、快速配置数据库连接信息

在 resources 文件夹下新建 db.properties 文件,配置数据库连接相关信息,具体代码配置如下:

jdbc.jdbcUrl=jdbc:mysql://localhost:3306/ssm_example?useUnicode=true&characterEncoding=UTF-8
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.user=root
jdbc.password=root

七、快速配置数据库操作辅助信息

在 resources 文件夹下新建 mybatis-config.xml 文件,配置相关的数据库操作辅助信息,具体代码配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<!-- 打印SQL-->
<setting name="logImpl" value="STDOUT_LOGGING" />
</settings> <typeAliases>
<!-- 指定一个包名,MyBatis会在包名下搜索需要的JavaBean-->
<package name="com.ssm.example.entity"/>
</typeAliases> </configuration>

八、快速配置 SpringMVC 注解扫描和视图解析器

在 resources 文件夹下新建 springmvc.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:mvc="http://www.springframework.org/schema/mvc"
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
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"> <!-- 启用 SpringMVC 注解驱动 -->
<mvc:annotation-driven /> <!-- 扫描业务代码 -->
<context:component-scan base-package="com.ssm.example"></context:component-scan> <!-- 配置视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/"></property>
<property name="suffix" value=".jsp"></property>
</bean> </beans>

九、快速新建数据表

新建 MySQL 数据库,快速新建数据表 ssm_example,具体建表代码如下:

DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`gender` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`tel` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`cla` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; INSERT INTO `student` VALUES (1, '孔乙己', '男', 'kongyiji@163.com', '13509856897', '计算机1班');
INSERT INTO `student` VALUES (2, '阿强', '女', 'aqiang@126.com', '12345678909', '软件工程');
INSERT INTO `student` VALUES (3, '阿福', '男', 'afu@12345.com', '13657898762', '数学专业');
INSERT INTO `student` VALUES (4, '阿霞', '女', '12345@qq.com', '12378645987', '英语专业');
INSERT INTO `student` VALUES (5, '指南者', '男', 'compassblog@gmail.com', '13587690873', '打杂搬砖专业'); SET FOREIGN_KEY_CHECKS = 1;

十、快速新建实体类

快速新建实体类 Student.java,具体代码如下:

package com.ssm.example.entity;

public class Student {

	private int id;
private String name;
private String gender;
private String email;
private String tel;
private String cla; public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getCla() {
return cla;
}
public void setCla(String cla) {
this.cla = cla;
} }

十一、快速书写业务代码

快速新建 StuentController.java 控制类,具体代码如下:

package com.ssm.example.controller;

import java.util.List;

import com.ssm.example.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import com.ssm.example.service.StudentService; @Controller
public class StudentController { @Autowired
private StudentService studentService; /**
* 查找所有学生
* @return
*/
@RequestMapping(value="/findAll")
public ModelAndView test(){
List<Student> list = studentService.findAll();
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("index");
modelAndView.addObject("list", list);
return modelAndView;
} }

快速新建 StudentService.java 接口,代码如下:

package com.ssm.example.service;

import java.util.List;

import com.ssm.example.entity.Student;

public interface StudentService {
public List<Student> findAll();
}

快速新建 StudentServiceImpl.java 类实现接口,具体代码如下:

package com.ssm.example.service.impl;

import java.util.List;

import com.ssm.example.dao.StudentDAO;
import com.ssm.example.entity.Student;
import com.ssm.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; @Service
public class StudentServiceImpl implements StudentService { @Autowired
private StudentDAO studentDAO; public List<Student> findAll() {
// TODO Auto-generated method stub
return studentDAO.findAll();
} }

快速新建 dao 接口 StudentDAO.java,具体代码如下:

package com.ssm.example.dao;

import java.util.List;

import com.ssm.example.entity.Student;

public interface StudentDAO {
public List<Student> findAll();
}

快速新建 dao 接口代理文件 StudentDAO.xml,具体代码如下:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ssm.example.dao.StudentDAO"> <resultMap type="Student" id="studentMap">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="gender" column="gender"/>
<result property="email" column="email"/>
<result property="tel" column="tel"/>
<result property="cla" column="cla"/>
</resultMap> <select id="findAll" resultMap="studentMap">
select * from student
</select> </mapper>

十二、新建访问页面

快速新建访问页面 index.jsp,并且页面使用 bootstrap 框架作轻度渲染,具体代码如下:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生列表</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap-3.3.7-dist/css/bootstrap.min.css">
</head>
<body>
<br><br><br>
<div class="container" align="center">
<div class="row">
<div class="col-md-12">
<h1>SSM 框架快速整合实例--学生查询</h1>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<table class="table table-hover" id="emps_table">
<thead>
<tr>
<th>
<input type="checkbox" id="check_all"/>
</th>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>电子邮箱</th>
<th>联系电话</th>
<th>班级</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach items="${list }" var="student">
<tr>
<td><input type='checkbox' class='check_item'/></td>
<td>${student.id }</td>
<td>${student.name }</td>
<td>${student.gender }</td>
<td>${student.email }</td>
<td>${student.tel }</td>
<td>${student.cla }</td> <td>
<button class="btn btn-primary btn-sm edit_btn">
<span class="glyphicon glyphicon-pencil">编辑</span>
</button>  
<button class="btn btn-danger btn-sm delete_btn">
<span class="glyphicon glyphicon-trash">删除</span>
</button>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div> </div>
</body>
</html>

十三、快速进行测试

到这里,SSM 框架整合程序就已经书写完毕,部署并启动 Tomcat 服务器,然后到浏览器地址栏测试,结果如下:

项目源码地址:点击这里直接获取源码

SSM框架快速整合实例——学生查询的更多相关文章

  1. SSM 框架快速整合实例--学生查询

    一.快速准备 SSM 框架即 Spring 框架.SpringMVC 框架.MyBatis 框架,关于这几个框架的基础和入门程序,我前面已经写过几篇文章作为基础和入门介绍了.对于这 3 个框架还不熟悉 ...

  2. SpringMVC笔记——SSM框架搭建简单实例

    落叶枫桥 博客园 首页 新随笔 联系 订阅 管理 SpringMVC笔记——SSM框架搭建简单实例 简介 Spring+SpringMVC+MyBatis框架(SSM)是比较热门的中小型企业级项目开发 ...

  3. SSM框架的整合思路&功能实现

    这是我第一篇博客,关于SSM框架的整合思路以及简单功能实现. 首先,最近刚刚学习Spring+SpringMVC+Mybatis,在开发时遇到形形色色的问题,周遭人也为我提供了一些思路,我会一点点整理 ...

  4. SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)【申明:来源于网络】

    SSM框架--详细整合教程(Spring+SpringMVC+MyBatis)[申明:来源于网络] 地址:http://blog.csdn.net/u014662268/article/details ...

  5. SSM框架——详细整合教程

    SSM框架——详细整合教程(Spring+SpringMVC+MyBatis) 1.基本概念   1.1.Spring Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Jav ...

  6. SSM框架的整合与使用——实现简单的转账系统

    一.整合思路 SSM框架即SpringMVC + Spring + MyBati框架集,是一种轻量级的Web开源框架.它们各自在JAVA三层架构中负责的模块如下图所示: 其中,SpringMVC与Sp ...

  7. SSM框架之整合(Maven实例)

    有不少朋友在maven中因为pom文件依赖的事导致报错 今天我这个快速搭建ssm框架,确保在jdk7或者jdk8的环境,tomcat没什么要求.但如果要用jdk8的话,最好用run as中的serve ...

  8. [置顶] Java Web学习总结(24)——SSM(Spring+SpringMVC+MyBatis)框架快速整合入门教程

    1.基本概念 1.1.Spring Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod Johnson 在其著作Expert One-On-One  ...

  9. SSM框架之整合EhCache

    本文主要讲ssm框架整合EhCache.或许有人会问什么是ehcache. 关于EhCache的介绍和优劣,我想下面的解答足以让读者明白: EhCache 是一个纯Java的进程内缓存框架,具有快速. ...

随机推荐

  1. C++实现的服务不可用发送报警邮件

    正在看C++,我主业是Java开发,但是最近服务不太稳定,自己用C++造了个小轮子. 配置好要监控的访问路径,IP.端口号和路径.涉及到的知识点有以下几个部分: 构造函数与析构函数 内存的分配与释放( ...

  2. 【进阶修炼】——改善C#程序质量(1)

    这是一个大纲形式的概要,以便自己可以花较少的时间反复阅读.在开发中,多加注意这些有用的建议,让自己成为一个更优秀的程序员.内容主要来自<编写高质量代码-改善C#程序的157个建议>(陆敏技 ...

  3. Shuffle机制

    一个map task处理一个切片Split,切片是一个范围的数据,和blocksize大小没有必然关系. 1.每个map有一个环形内存缓冲区,用于存储任务的输出.默认大小100MB(io.sort.m ...

  4. [数据结构]A*寻路算法

    简易地图 如图所示简易地图, 其中绿色方块的是起点 (用 A 表示), 中间蓝色的是障碍物, 红色的方块 (用 B 表示) 是目的地. 为了可以用一个二维数组来表示地图, 我们将地图划分成一个个的小方 ...

  5. hbase 学习(十二)非mapreduce生成Hfile,然后导入hbase当中

    最近一个群友的boss让研究hbase,让hbase的入库速度达到5w+/s,这可愁死了,4台个人电脑组成的集群,多线程入库调了好久,速度也才1w左右,都没有达到理想的那种速度,然后就想到了这种方式, ...

  6. Ubuntu16.04怎么将桌面左侧的启动器移动到屏幕底部

    与其他 Linux 发行版不同,Ubuntu 多年来一直使用 Unity 做桌面环境,该环境的最突出特点就是桌面左侧有一个启动器栏(Launcher).从 16.04 版本开始,Ubuntu 提供了一 ...

  7. 添加相应型号和头文件到Keil中

  8. CSS Notes

    Margin vs. PaddingMargin is on the outside of block elements while padding is on the inside. Use mar ...

  9. MWeb 的基本使用

    MWeb 的文档库模式和外部模式 MWeb 分为文档库模式和外部模式,下面分别说明. 文档库模式 软件一开始打开就是文档库模式了,开始时需要设置文档库保存的位置,之后所有文档都会保存在这个位置.文档库 ...

  10. Self20171218_Eclipse+TestNg HelloWorld

    作为一个经典的入门例子,这里展示如何开始使用TestNG单元测试框架. 使用的工具 : TestNG 6.8.7 Maven 3 Eclipse IDE TestNG下载并安装 从这里 http:// ...