摘要:一、安装JDK 下载地址:https://www.oracle.com/java/technologies/downloads/#java8-windows pei 二、安装maven 下载地址:https://maven.apache.org/download.cgi maven优势:首先从本地仓
阅读全文
摘要:1、spring boot 自带了日志组件,不需要引入包 2、配置application.yml文件内容 # 最新日志必须使用这个类型配置,否则会报错 level: com.example: debug org.springframework: warn config: classpath:log/
阅读全文
摘要:一、引入包,pom.XML配置如下 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <dep
阅读全文
摘要:一、概述 对于Flyway,对数据库的所有更改都称为迁移。迁移可以是版本控制的,也可以是可重复的。版本化迁移有两种形式:常规迁移和撤消迁移 版本化迁移有一个版本、一个描述和一个校验和。版本必须是唯一的。为了让您能够记住每次迁移所做的事情,本文的描述纯粹是提供信息的。校验和用于检测意外变化。版本化迁移
阅读全文
摘要:一、创建spring boot项目,引入依赖,引入lombock依赖, mysql-connector-java mybatis-plus-boot-starter junit spring-test 依赖 <?xml version="1.0" encoding="UTF-8"?> <projec
阅读全文
摘要:1、引入引用 <?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"
阅读全文
摘要:@EnableGlobalMethodSecurity三方法详解 要开启Spring方法级安全,在添加了@Configuration注解的类上再添加@EnableGlobalMethodSecurity注解即可 /** * spring security配置 * @EnableGlobalMetho
阅读全文
摘要:一、新建SpringBoot项目 ,选择Maven,插件选择SpringWeb 二、引入springSecurity包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-s
阅读全文
摘要:一、SpringSecurity主要用于鉴权和授权功能,他的过滤器链路如图 BasicAuthenticationFilter实现的是HttpBasic模式的登录认证 UsernamePasswordAuthenticationFilter实现用户名密码的登录认证 RememberMeAuthent
阅读全文
摘要:一、集成mybatis, Invalid bound statement (not found): com.example.spring1030001.Services.DemoService.getUser 1、检查mapper.xml文件地址是否对了 2、xml文件 的方法和接口的方法是否一致
阅读全文
摘要:1、新建springboot项目,选择mysql、jdbc、web,使用maven管理项目 2、检查pom.xml依赖,已经添加了mybatis、spring-boot、junit依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="ht
阅读全文
摘要:1、创建拦截器,返回true表示通过,返回false表示失败,用于身份认证、权限登录、注解判断等 public class MyInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpSer
阅读全文
摘要:1、创建过滤器,注意:controller 、filter、config需要放置在application的子包下面,否则扫描不到,用于请求管道 public class MyFilter implements Filter { @Override public void init(FilterCon
阅读全文