
SpringBoot学习记录
文章平均质量分 54
奔跑的废柴
卧久者行必远,伏久者飞必高
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Spring Boot 自动装配原理
Spring Boot 自动装配的核心是@SpringBootApplication注解。它是一个组合注解,包含了@Configuration、@EnableAutoConfiguration和@ComponentScan。原创 2024-11-13 14:56:08 · 640 阅读 · 0 评论 -
AOP介绍
1.重要概念1.1 通知通知:就是会在目标方法执行前后 执行的方法try{ try{ //@Before method.invoke(..); }finally{ //@After } //@AfterReturning}catch(){ //@AfterThrowing}举例,以下这个方法就是通知,目标方法是UserDao类的addUser(),在addUser执行之后执行了log方法,所以log方原创 2021-01-07 11:25:11 · 207 阅读 · 0 评论 -
SpringBoot的一些概念
什么是Spring Boot Starter什么是Spring Boot Starter Parent原创 2021-01-02 13:29:34 · 123 阅读 · 0 评论 -
idea中多选的快捷键
ctrl+shift+alt原创 2020-08-09 16:43:19 · 4772 阅读 · 0 评论 -
SpringBoot创建定时任务SchedulingTasks
新的学习方式:开始看一遍Spring官网的Guides1.在pom.xml中添加依赖 <dependency> <groupId>org.awaitility</groupId> <artifactId>awaitility</artifactId> <version>3.1.2</version> <sc原创 2020-07-16 13:47:18 · 214 阅读 · 0 评论 -
idea中导包的快捷键
导包:alt+enter经过了这么久不写我已然忘记了所有快捷键…原创 2020-07-12 08:57:33 · 811 阅读 · 0 评论 -
2.运行项目——利用idea中的cloud toolkit插件将springboot项目部署到阿里云
上一篇链接:1.连接和上传——利用idea中的cloud toolkit插件将springboot项目部署到阿里云上传到服务器后,想让项目运行,还要解决很多坑。1.命令进入存放jar和sh的文件夹然后java -jar 201911b-0.0.1-SNAPSHOT.jar具体换成自己的jar包名不出意外的话springboot项目就启动了 可以访问了but,我没这么顺利2.报错(原...原创 2019-12-02 21:19:28 · 522 阅读 · 0 评论 -
1.连接和上传——利用idea中的cloud toolkit插件将springboot项目部署到阿里云
前言:妈妈问我为什么哭着写博客 到处是坑1.插件安装参考:添加链接描述2.添加服务器点 Add Post然后点 Test Connection 测试是否能连接成功点Add添加完成可以看到自己的服务器ip3.修改pom.xml <skipTests>true</skipTests> 这段...原创 2019-12-02 21:05:40 · 323 阅读 · 0 评论 -
jwt退出登录/修改密码时如何使原来的token失效
其实前端删掉这个Token不就行了吗(小声bb不行,这样即使退出登录后拿着以前的token还是可以访问到。看了半天,感觉网上没有好的解决方案。真让人头大。如何Logout呢?既然接口有这个要求,必须实现啊。绞尽脑汁,写一下可行的两种方法,虽然还是挺蠢的。第一种办法:登录第一次生成token时,把token存入数据库。每次请求验证一下是不是和数据库的token一样。退出登录时,删掉数据...原创 2019-11-20 20:08:45 · 16716 阅读 · 22 评论 -
SpringBoot redis第三篇——spring cache
本系列前面文章1.SpringBoot redis第一篇——使用redisTemplate操作数据2.SpringBoot redis第二篇——使用Redis Repository操作数据hashpom.xml添加依赖<dependency> <groupId>org.springframework.boot</groupId> <...原创 2019-10-27 12:30:54 · 216 阅读 · 0 评论 -
SpringBoot redis第二篇——使用Redis Repository操作数据hash
本系列前面的文章使用redisTemplate操作数据将对象一次性hash入库的方法方法一:使用Jackson2HashMapper @Resource(name="redisTemplate") private HashOperations<String, String, Object> jacksonHashOperations; private Ha...原创 2019-10-27 11:45:57 · 1310 阅读 · 0 评论 -
SpringBoot redis第一篇——使用redisTemplate操作数据
1.pom.xml中添加依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId></dependency><dependency...原创 2019-10-27 10:46:26 · 395 阅读 · 0 评论 -
SpringBoot整合mybatis操作步骤
引入依赖 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>...原创 2019-10-20 20:30:22 · 186 阅读 · 0 评论 -
AOP实现全局异常处理SpringBoot
【AjaxResponse】响应类package com.example.mytoken.model;import com.example.mytoken.config.exception.CustomException;import com.example.mytoken.config.exception.CustomExceptionType;import lombok.Data;...原创 2019-10-13 14:09:15 · 1095 阅读 · 0 评论 -
SpringBoot使用JWT实现Token登录验证
前言:之前搞了几天没成功…今天最终是写好了!Token如何实现登录验证:登录时服务器接收用户名密码,如果正确就生成一个Token返回前端,以后每次需要登录才能发起的请求,要在请求头带服务器之前给的Token,正确才能访问。遇到的几个头大问题:1.在Service层忘了写VO和PO的转换2.请求时路径写了方法名还一直奇怪为什么404总结:我是憨憨但是真的头大了很久!完整项目代码的gith...原创 2019-10-12 21:34:14 · 1311 阅读 · 6 评论 -
SpringBoot中验证用户是否登录——HandlerInterceptor拦截器的实现
1.写一个拦截器CustomHandlerInterceptor@Slf4jpublic class CustomHandlerInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse resp...原创 2019-09-29 18:23:49 · 2515 阅读 · 0 评论 -
在IDEA中新建一个基于SpringBoot的Restful增删改查jdbc接口
一头雾水学习SpringBoot的菜鸟,跟着网上的教程成功复制粘贴了一遍(艰难落泪现在自己敲一遍加深理解和记忆。0.设置Maven环境(这里可以忽略…我有几个Maven)1.更改pom.xml文件,引入需要的依赖。(注意版本…可能会出错)<dependencies> <dependency> <groupId>or...原创 2019-09-22 21:20:23 · 871 阅读 · 0 评论