Spring框架必须
|
Spring Core
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring-version}</version>
</dependency>
|
Spring Context
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring-version}</version>
</dependency>
|
Spring Beans
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring-version}</version>
</dependency>
|
Spring AOP
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring-version}</version>
</dependency>
|
Spring整合ORM框架
|
Spring Object/Relational Mapping
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring-version}</version>
</dependency>
在applicationContext中用到
xmlns:tx="http://www.springframework.org/schema/tx"
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
<tx:annotation-driven></tx:annotation-driven>
|
Spring对web的支持
|
Spring Web
配置web.xml,引入applicationContext.xml
<!--spring对web的支持
1.新建一个applicationContext.xml
2.把applicationContext.xml写到web.xml(整个web项目的启动文件)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring-version}</version>
</dependency>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
|
SpringMVC
|
Spring Web MVC
配置web.xml,引入spring-servlet.xml
全面取代Struts2
<!-- SpringMVC,取代Struts,跟spring整合不需插件 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring-version}</version>
</dependency>
注意:pringMVC与spring是无缝接入,不需要插件
但是Struts2跟Spring整合,是需要插件
|
SpringMVC输出JSON
|
Jackson Core
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
|
Jackson Databind
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
|
Jackson Annotations
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
</dependency>
|
Mybatis
|
mybatis
<!-- Mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis-version}</version>
</dependency>
|
Mybatis-spring
|
mybatis-spring
<!--Spring与Mybaits整合:1.SqlSessionFactory,2.Dao-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring-version}</version>
</dependency>
|
数据库的驱动
|
Oracle需要配置Maven私有仓库,或者直接引用
|
C3P0
|
c3p0
<!--c3p0是一个非常稳定的数据库连接池-->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>${c3p0-version}</version>
</dependency>
|
JSTL
|
|