![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
小麦先森
科技,让事情回归简单
展开
-
Spring配置mapper扫描的两种方式
一, mapperLocations方式 1, spring-mybatis.xml 2, 项目结构 3, numMapper.xml 二, configLocation方式 1, spring-mybatis.xml 2, mybatis-config.xml 3, BankMapper.xml 二者的区别: mapperLocations方式直接...原创 2018-12-29 15:40:21 · 12094 阅读 · 4 评论 -
《springboot学习笔记 02》--访问数据库
## 需求 对本地mysql数据库进行访问: 方式1, 用JdbcTemplate相关配置; 方式2, 集成Mybatis相关配置 一,用JdbcTemplate相关配置 1, pom.xml配置依赖 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/200...原创 2019-01-04 21:50:50 · 146 阅读 · 0 评论 -
《springboot学习笔记 01》--打印helloworld
一, 基础项目搭建 1, 新建一普通maven项目(C:\work\workspace\a-sptingboot-test) 2, pom.xml配置 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent&...原创 2019-01-02 16:30:03 · 232 阅读 · 0 评论 -
《springboot学习笔记 03》--单元测试
接着上一篇: 《springboot学习笔记 02》--访问数据库 需求, 对StudentService的getStudent()方法进行单元测试 1, pom.xml添加依赖 <!-- 单元测试 --> <dependency> <groupId>org.springframework.boot</groupId> <a...原创 2019-01-13 11:46:07 · 134 阅读 · 0 评论 -
《springboot学习笔记 04》--AOP用法
接着上上一篇: 《springboot学习笔记 02》--访问数据库 需求: 访问接口(http://localhost:8081/mydb2/getStudent)查询Student数据之前, 先校验是否登录 1, pom.xml添加依赖 <!-- aop登录校验 --> <dependency><!-- spring boot aop start...原创 2019-01-13 15:41:20 · 135 阅读 · 0 评论 -
《springboot学习笔记 05》--全局异常处理
接着之前的一篇: 《springboot学习笔记 02》--访问数据库 需求: 对业务代码中出现的异常进行统一处理 1, 写一个存在异常的接口StudentController2.getStudent() @RequestMapping("/getStudent") public Object/*List<Student>*/ getStudent() throw...原创 2019-01-13 17:02:40 · 141 阅读 · 0 评论