随笔分类 - SpringBoot
摘要:(目录) 前言 记录下SpringBoot集成MongoDB实现文件上传的步骤 MongoDB - 5.0.6安装包 链接:https://pan.baidu.com/s/1lCcPvYYNWncb6lbvrZdeVg 提取码:0tf1 环境 SpringBoot - 2.5.12 MongoDB 
        阅读全文
            
摘要:(目录) 前言 记录下SpringBoot修改yml配置文件后无需重启服务的方式(打包后生效),效果如下: 具体实现 实现代码 pom.xml <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artif
        阅读全文
            
摘要:(目录) 前言 记录下AOP实现登录状态的检查,文章使用的JWT校验参考:SpringBoot - 集成Auth0 JWT 实现登录状态检查的方式 Servlet过滤器 拦截器 Spring AOP AOP 定义 AOP(Aspect Oriented Programming),面向切面编程,通过预
        阅读全文
            
摘要:(目录) 前言 @Autowired默认情况下要求依赖对象必须存在,而IDEA对于Mybatis接口的注入是无法理解的,被认为该对象是null,虽然代码能正常运行,但有警告总归膈应 解决方案 为 @Autowired 注解设置 required = false 设置required = false后
        阅读全文
            
摘要:(目录) 前言 Actuator是SpringBoot中的重要组件,为应用程序提供了强大的监控能力 具体使用 依赖 pom.xml <!-- actuator --> <dependency> <groupId>org.springframework.boot</groupId> <artifact
        阅读全文
            
摘要:(目录) 前言 最近项目中用到了Mybatis的通用代码生成器mybatis-generator,记起之前记录过的一篇文章 mybatis 生成代码配置 mybatis-generator:generate 的使用详解,用的是同一套东西,只是对比起之前添了一点东西 1、开发工具Eclipse -> 
        阅读全文
            
摘要:(目录) 前言 记录下最近项目中用到的Mybatis实体类与数据结果集的映射方式。 测试用例 查询商品及其子项信息 Table CREATE TABLE `product` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varcha
        阅读全文
            
摘要:(目录) 前言 记录下SpringBoot下静态资源存储服务器的搭建。 环境 win10 + SpringBoot2.5.3 实现效果 文件上传: 文件存储位置: 文件访问: 具体实现 文件上传 配置类 pom.xml <dependency> <groupId>org.springframewor
        阅读全文
            
摘要:(目录) 前言 AutoGenerator是MyBatis-Plus的代码生成器,通过AutoGenerator可以快速生成Entity、Mapper、Mapper XML、Service、Controller等各个模块的代码,这里介绍下SpringBoot中集成MyBatis-Plus代码生成器C
        阅读全文
            
摘要:(目录) 前言 记录下Mybatis-Plus中条件构造器Wrapper 的一些基本用法。 查询示例 表结构 CREATE TABLE `product` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) CO
        阅读全文
            
摘要:(目录) 前言 记录下Mybatis-Plus的分页查询,Mybatis-Plus的整合在上一篇文章:SpringBoot - 整合Mybatis-Plus 环境 SpringBoot2.53 + Mybatis-Plus3.3.0 具体实现 配置类 import com.baomidou.myba
        阅读全文
            
摘要:(目录) 前言 Mybatis-Plus是Mybatis的增强,Mybatis-Plus在Mybatis的基础上借鉴了很多JPA的做法,记录下SpringBoot下的整合方法。 环境 SpringBoot2.53 + Mybatis-Plus3.3.0 具体实现 项目结构 项目配置 pom.xml 
        阅读全文
            
摘要:(目录) 前言 项目接口访问出现allowedOrigins cannot contain the special value "*" java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins 
        阅读全文
            
摘要:(目录) 前言 Mybatis是一个半自动化ORM(Object Relation Mapping)框架, 之所以说Mybatis半自动化,是因为SQL语句需要用户自定义,SQL的解析,执行等工作由Mybatis执行,这里记录下SpringBoot 整合Mybatis的案例。 环境 SpringBo
        阅读全文
            
摘要:(目录) 前言 记录下SpringBoot读取JSON文件的方式 具体实现 JsonUtil.java import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java
        阅读全文
            
摘要:(目录) 前言 CommandLineRunner接口在容器启动成功后最后一步调用,常用于应用程序启动后初始化操作,其在整个应用生命周期内只会执行一次。 具体应用 实现CommandLineRunner接口 Runner.java import org.springframework.boot.Co
        阅读全文
            
摘要:(目录) 前言 RocketMQ是阿里巴巴在2012年开源的分布式消息中间件,记录下SpringBoot整合RocketMQ的方式,RocketMQ的安装可以查看:Windows下安装RocketMQ 环境 SpringBoot2.5.3 + RocketMQ4.7.0 具体实现 pom.xml <
        阅读全文
            
摘要:(目录) 前言 SpringBoot + Redis 可以用 Redis 的键空间通知机制实现类似延迟消息队列的功能 ,Redis2.8 后可以通过键空间通知接收那些以某种方式改变了Redis数据空间的事件通知,关于 Redis 键空间通知的配置 Redis-x64-3.2 键空间通知(keyspa
        阅读全文
            
摘要:(目录) 前言 记录下SpringBoot集成Redis的方式。 环境 SpringBoot2.5.3 + Redis-x64-3.2.1 具体实现 pom.xml <!-- redis --> <dependency> <groupId>org.springframework.boot</grou
        阅读全文
            
摘要:(目录) 前言 拦截器中使用@Autowired时为空,这是因为拦截器加载是在Spring Bean创建之前。 public class PermissionInterceptor implements HandlerInterceptor { @Autowired private UserServ
        阅读全文
            

 
 浙公网安备 33010602011771号
浙公网安备 33010602011771号