1.注册webapp为资源目录,
2,导入tomcat-embeb-jasper
3.
mybatis整合
1.pom文件中导入spring boot 和mybatis整合依赖,druid依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.17</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.4</version>
</dependency>
2.在application.yml注册dao.xml
# =============================== 应用设置 ===============================
server:
port: 9989
# =============================== spring配置 ===============================
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
username: root
password: xxx
url: jdbc:mysql://localhost:3306/test?useSSL=false&useUnicode=true&characterEncoding=utf-8&connectionCollation=utf8mb4_unicode_ci
mvc:
view:
prefix: /
suffix: .jsp
mybatis:
type-aliases-package: com.kaikeba.jspdemo.bean
mapper-locations: classpath:dao/*.xml