spring boot
壹零零壹
路漫漫兮其修远,吾将上下而求索。
展开
-
spring boot使用spring security 的基本配置 以及 限制同一账号不能多处登录
关于如何spring boot 整合spring security 请自行百度,这里只是简单描述spring security 的配置项。 @Configuration@EnableWebSecurity@EnableGlobalMethodSecurity(prePostEnabled = true)// 启用 Spring Security 全局方法//prePostEnabled...原创 2019-01-09 17:29:13 · 1861 阅读 · 0 评论 -
关于SpringBoot 部署到Linux服务器 找不到static下的静态资源问题
//// 因为Springboot是内嵌web容器,其特点是只有一个jar文件,在容器启动后不会解压缩,// 这里就有一个问题,由于文件被保存在jar中,会导致读取失败,this.getClass().getResource("/")+fileName在本地windows下能完美找到路径,// 比如;File logoFile = new File(ClassUtils.g...原创 2019-03-06 12:35:25 · 4315 阅读 · 2 评论 -
关于 springBoot 使用 swagger2生成接口文档 的正确姿势
一、先添加 Swagger2 所需要的依赖包 <!--swagger2接口文档--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> ...原创 2019-06-15 16:29:34 · 1157 阅读 · 0 评论 -
Spring Boot 整合 Mybatis笔记(二):如何正确书写满足基本操作 的Mybatis Mapper.xml文件
一、在mapper中几个常用元素1. select –映射查询语句2. insert –映射插入语句3. update –映射更新语句4. delete –映射删除语句5. sql –可以重用的 SQL 块,也可以被其他语句引用6. bind –将OGNL表达式的值绑定到一个变量中,方便后来引用这个变量的值二 、在mapper中几个常用元素...原创 2019-06-22 11:32:52 · 4084 阅读 · 2 评论 -
Spring Boot 整合 Mybatis 笔记(一):细说 Mybatis 在 springboot 中的基本常用配置
这里以配置的是application.yaml一、 数据源spring:datasource: url: jdbc:mysql://localhost:3306/test?serverTimezone=GMT%2B8&useSSL=false username: root password: 123456 driver-class-name: com....原创 2019-06-22 11:32:09 · 458 阅读 · 0 评论