pom.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0
<groupId>com.xiangzi
<artifactId>ssmbuild
<version>1.0-SNAPSHOT
<!--依赖:junit,数据库驱动,连接池,servlet,jsp,mybatis,mybatis-spring,spring-->
<groupId>junit
<artifactId>junit
<version>4.12
<scope>test
<!--数据库驱动-->
<groupId>mysql
<artifactId>mysql-connector-java
<version>5.1.47
<!--数据库连接池: c3p0-->
<groupId>com.mchange
<artifactId>c3p0
<version>0.9.5.2
<groupId>servletapi
<artifactId>servletapi
<version>2.4-20040521
<groupId>javax.servlet.jsp
<artifactId>jsp-api
<version>2.2
<groupId>javax.servlet
<artifactId>jstl
<version>1.2
<groupId>org.mybatis
<artifactId>mybatis
<version>3.5.2
<groupId>org.mybatis
<artifactId>mybatis-spring
<version>2.0.2
<groupId>org.springframework
<artifactId>spring-webmvc
<version>5.1.9.RELEASE
<groupId>org.springframework
<artifactId>spring-jdbc
<version>5.1.9.RELEASE
<!--静态资源导出问题-->
<directory>src/main/java
<include>**/*.properties
<include>**/*.xml
<filtering>false
<directory>src/main/resources
<include>**/*.properties
<include>**/*.xml
<filtering>false
</project>
resources下新建mybatis-config.xml、applicationContext.xml
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>
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">
</beans>
网友评论