摘要: SpringBoot 引入 Redis 相关依赖后,默认的缓存管理器会自动切换成 Redis 的。 配置完后有用的文章: docker 部署 Redis: https://www.cnblogs.com/acdongla/p/16389485.html 自动json序列化: https://www. 阅读全文
posted @ 2021-12-18 01:14 yangruomao 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 知识体系 注解 注解参数 SpEL 表达式 refer: 尚硅谷springboot课程ppt 使用缓存 可以添加添加日志配置方便查看状态 查看 cc.acongla.boot.mapper 包下的 debug 日志信息: 在 springboot 启动类中打开缓存 使用注解 值得注意的地方: @C 阅读全文
posted @ 2021-12-18 00:16 yangruomao 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 使用 springboot + mybati plus 查询数据时报错 sprintgboot Unknown column '字段名' in 'field list' 如果 mybatis 配置无误,可以检查一下数据库表中的字段名。 我把表中驼峰命名改成下划线,就好了。 阅读全文
posted @ 2021-12-11 12:28 yangruomao 阅读(274) 评论(0) 推荐(0) 编辑
摘要: application.yaml 阅读全文
posted @ 2021-12-07 11:15 yangruomao 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 利用正则讲 \n 替换为 br,插入html即可 场景:显示新闻 后端响应 json, 前端接受数据,将新闻显示在页面上 这里以 Vue 代码为例 文本显示为html 替换 使用正则替换 \n 为 br, /g 表示匹配全部 效果 阅读全文
posted @ 2021-11-22 01:24 yangruomao 阅读(1186) 评论(0) 推荐(0) 编辑
摘要: RDB 默认开启,AOF 需手动开启,他们生成的文件都在 redis-service 目录下。 如果数据无所谓,可以单独使用RDB。 如果只做为缓存使用,RDB和AOF都不需要开启。 其他情况官方建议都开启。 数据文件位置示例: 开启 AOF 打开配置文件 修改 appendonly no 值为 y 阅读全文
posted @ 2021-11-16 13:53 yangruomao 阅读(513) 评论(0) 推荐(0) 编辑
摘要: 打开 redis 的配置文件 这里我是 vi /etc/redis.conf 可利用搜索功能 找到 bind 127.0.0.1 -::1 ,把这一行注释掉 找到 protected-mode yes 把 yes 改为 no 设置永久密码: 找到 requirepass 其后的值就是密码。 默认是被 阅读全文
posted @ 2021-11-14 14:32 yangruomao 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Git git 常用命令 设置用户签名 git config --global user.name 用户名 git config --global user.email 邮箱 初始化本地库 git init 查看本地库状态 git status 添加到暂存区 git add hello.txt # 阅读全文
posted @ 2021-11-13 00:51 yangruomao 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 使用 JSR303 校验 防止用户修改前端代码造成的bug 本次示例: ​ 校验用户输入信息,然后保存在数据库中 导入依赖 <dependency> <groupId>org.hibernate.validator</groupId> <artifactId>hibernate-validator< 阅读全文
posted @ 2021-11-07 16:13 yangruomao 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 示例:模拟 /emps?pn=1 请求;拿到请求域;获取请求域对象;从请求域中拿对象 @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration(locations = {"classpath: 阅读全文
posted @ 2021-11-02 10:11 yangruomao 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 详情见 官方文档 目录结构 供参考 Maven依赖 <!-- mybatis-generator--> <!-- https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core --> <dependen 阅读全文
posted @ 2021-10-31 12:20 yangruomao 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 官方文档: http://mybatis.org/ehcache-cache/ 1. 引入依赖 或 Maven <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-core</artifactId> <version> 阅读全文
posted @ 2021-10-30 12:18 yangruomao 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 结构 更新:+ mybatis plus maven依赖 spring相关 servlet和jsp mybatis相关 mysql驱动和c3p0连接池 junit4和jstl <dependencies> <!--spring相关--> <dependency> <groupId>org.sprin 阅读全文
posted @ 2021-10-24 14:39 yangruomao 阅读(618) 评论(0) 推荐(0) 编辑
摘要: **错误原因:**mapper文件不匹配 检查 mapper 文件有没有写错 检查 mapper 的导入配置,注意不能跨包导入 mapper 检查 target/classes 里有没有生成对应的 mapper 文件,如果没有,解决办法如下 在pom.xml中加入以下配置,并clean后重新编译 < 阅读全文
posted @ 2021-10-24 12:47 yangruomao 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 项目构建命令 在pom.xml所在目录内运行 mvn compile #编译 mvn clean #清理 mvn test #测试 mvn package #打包 mvn install #安装到本地仓库 tomcat 插件 <build> <plugins> <plugin> <groupId>o 阅读全文
posted @ 2021-10-20 22:39 yangruomao 阅读(53) 评论(0) 推荐(0) 编辑