![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
xixihaha_coder
坚持就是胜利!
展开
-
springsecurity复习
springsecurity复习原创 2022-10-12 16:23:07 · 725 阅读 · 0 评论 -
Springboot复习
Springboot复习原创 2022-10-12 09:49:09 · 727 阅读 · 0 评论 -
Shiro框架
Shiro框架原创 2022-10-12 09:17:27 · 2363 阅读 · 0 评论 -
springsecurity学习
springsecurity学习原创 2022-08-05 11:44:21 · 115 阅读 · 0 评论 -
springboot cache的使用
springboot cache的使用原创 2022-08-04 15:08:06 · 501 阅读 · 0 评论 -
springboot使用redis
springboot使用redis原创 2022-08-04 15:07:15 · 82 阅读 · 0 评论 -
拦截器通过自定义注解来判断是否拦截
自定义注解来判断是否拦截原创 2022-08-04 09:06:05 · 296 阅读 · 0 评论 -
服务器安装部署
服务器安装部署原创 2022-08-03 16:24:22 · 508 阅读 · 0 评论 -
springboot上传-下载文件-Hutool
springboot上传-下载文件-Hutool原创 2022-07-30 22:15:13 · 3061 阅读 · 2 评论 -
SprinBoot集成JWT实现token验证拦截
SprinBoot集成JWT实现token验证拦截原创 2022-07-30 19:16:55 · 297 阅读 · 0 评论 -
SprinBoot自定义异常(统一异常处理)
SprinBoot自定义异常(统一异常处理)原创 2022-07-30 18:47:47 · 101 阅读 · 0 评论 -
springboot实现上传excel保存数据到数据库
springboot实现上传excel保存数据到数据库原创 2022-07-30 18:19:28 · 1234 阅读 · 0 评论 -
springboot实现导出数据库数据
springboot导出数据库数据原创 2022-07-30 18:18:12 · 1605 阅读 · 0 评论 -
springboot解决跨域问题
springboot解决跨域问题在Springboot项目里加上这个配置文件CorsConfig.java,重启之后即可实现跨域访问,前端无需再配置跨域。import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.cors.CorsConfiguration;import o原创 2022-03-11 09:57:05 · 297 阅读 · 0 评论 -
29-定时任务
定时任务cron表达式可以用在线cron编辑器1.开启注解支持@EnableScheduling //开启定时功能的注解@SpringBootApplicationpublic class Spring09TestApplication { public static void main(String[] args) { SpringApplication.run(Spring09TestApplication.class, args); }}2.s原创 2021-09-26 13:56:35 · 161 阅读 · 0 评论 -
28-邮件任务
邮件任务1.导包<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId></dependency>2.配置spring.mail.username=2545644870@qq.comspring.mail.password=gmxawscfvzvoecj原创 2021-09-26 13:56:00 · 224 阅读 · 0 评论 -
27-异步任务
异步任务1.创建新项目2.service层@Servicepublic class AsyncService { //告诉spring这是一个异步的方法 @Async public void hello(){ try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); }原创 2021-09-26 13:55:30 · 63 阅读 · 0 评论 -
26-Swagger
前后端集成联调,前端人员和后端人员无法做到“即使协商,尽早解决”,最终导致问题集中爆发;解决方案:首先指定schema[计划的提纲],实时更新最新API,降低集成的风险;·早些年:指定word计划文档;前后端分离:。前端测试后端接口:postman。后端提供接口,需要实时更新最新的消息及改动!Swagger解决以上问题号称最流行的框架Springboot集成Swagger1.创建新springboot项目2.导入jar包<!-- 3.0.0需要加入启动包 --.原创 2021-09-26 13:54:52 · 75 阅读 · 0 评论 -
25-shiro整合thymeleaf
shiro整合thymeleaf效果就是对应的权限展示对应的页面1.导包<!-- shiro-thymeleaf整合 --> <dependency> <groupId>com.github.theborakompanioni</groupId> <artifactId>thymeleaf-extras-shiro</artifactId>原创 2021-09-23 15:54:26 · 126 阅读 · 0 评论 -
24-shiro请求授权实现
shiro请求授权实现1.configShiroConfig //添加shiro的内置过滤器 Map<String, String> map = new LinkedHashMap<>(); //-------------授权,正常情况,未授权会跳转带未授权页面 //限制访问add页面,和update页面 map.put("/user/add","perms[user:add]"); map原创 2021-09-23 15:53:52 · 114 阅读 · 0 评论 -
23-shiro整合mybatis
shiro整合mybatis1.导包<!-- 整合mybatis--> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> <dependency>原创 2021-09-23 15:52:43 · 148 阅读 · 0 评论 -
22-shiro实现用户认证
shiro实现用户认证1.前端登录表单提交后2.configUserRealm @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { System.out.println("执行了认证"); String name="root"; String p原创 2021-09-23 15:52:03 · 140 阅读 · 0 评论 -
21-shiro实现登录拦截
shiro实现登录拦截1.configShiroConfig//ShiroFilterFactoryBean :3 @Bean public ShiroFilterFactoryBean getShiroFilterFactoryBean(@Qualifier("securityManager") DefaultWebSecurityManager defaultWebSecurityManager){ ShiroFilterFactoryBean bean =原创 2021-09-23 15:50:49 · 223 阅读 · 0 评论 -
20-springboot整合shiro
springboot整合shiro三大对象subjectsecurity managerrealm搭建环境1.导包<dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.7.1</version&g原创 2021-09-23 15:49:50 · 76 阅读 · 0 评论 -
19-记住我及首页定制
记住我及首页定制//开启记住我功能 cookie 默认两周http.rememberMe();定制自己的登录页<!DOCTYPE html><html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"><head> <meta charset="UTF原创 2021-09-20 17:39:47 · 78 阅读 · 0 评论 -
18-注销及权限控制
注销及权限控制注销前端<a th:href="@{/logout}">注销</a><!--这个logout请求是security的-->注销后端config //注销,开启注销功能,跳到首页 http.logout().logoutSuccessUrl("/");权限控制导包 <dependency> <groupId>org.thymeleaf.extras</groupId>原创 2021-09-20 17:39:13 · 81 阅读 · 0 评论 -
17-用户认证和授权
用户认证和授权导包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency>configpackage com.tian.config;import org.sprin原创 2021-09-20 17:38:31 · 128 阅读 · 0 评论 -
16-SpringSecurity环境搭建
SpringSecurity环境搭建在web开发中,安全第一位! 过滤器,拦截器~功能性需求:否做网站:安全应该在什么时候考虑?设计之初!漏洞,隐私泄露~架构一旦确定~shiro、SpringSecurity:很像~除了类不一样,名字不一样;认证,授权(vip1,vip2,vip3)导包创建项目记得勾选web导入thymeleaf包结构...原创 2021-09-20 17:38:03 · 122 阅读 · 0 评论 -
15-整合Druid数据源
整合Druid数据源导入依赖 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.9</version> </dependency>配置druid的配置网上去搜application.y原创 2021-09-18 16:54:02 · 89 阅读 · 0 评论 -
14-整合Mybaits数据库
整合Mybaits数据库(重点)1. 导包 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.2.0</version> </depe原创 2021-09-18 16:53:27 · 146 阅读 · 0 评论 -
13-整合JDBC使用
整合JDBC使用创建一个新项目连接数据库spring: datasource: username: root password: root url: jdbc:mysql://localhost:3306/mybatis?serverTimezone=UTC&useUnicode=ture&characterEncoding=utf-8 driver-class-name: com.mysql.cj.jdbc.Driver先测试数据库连接原创 2021-09-18 16:52:45 · 86 阅读 · 0 评论 -
12-员工管理系统
员工管理系统准备工作pojoDepartment@Data@NoArgsConstructor@AllArgsConstructorpublic class Department { private Integer id; private String departmentName;}Employeeimport java.util.Date;@Data@NoArgsConstructorpublic class Employee { private I原创 2021-09-16 11:51:01 · 247 阅读 · 0 评论 -
11-mvc配置原理
mvc配置原理扩展springmvcpackage com.kuang.config;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.EnableWebMvc;import org.springframework.web.servlet.config.annotation.ViewControllerRegis原创 2021-09-16 11:44:58 · 121 阅读 · 2 评论 -
10-thymeleaf模板引擎
thymeleaf模板引擎1.引入依赖<dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring5</artifactId></dependency><dependency> <groupId>org.thymeleaf.extras</groupId> <artif原创 2021-09-14 12:00:31 · 93 阅读 · 0 评论 -
09-首页和图标定制
首页和图标定制首页图标定制1.图片命名为favicon.ico2.放在public目录下3.更改配置#关闭默认图标 ,新版本没有spring.mvc.favicon.enabled=false4.测试访问原创 2021-09-14 11:59:45 · 65 阅读 · 0 评论 -
08-静态资源导入
静态资源导入创建时要勾选web自定义静态资源位置(但是一般不会这么干)原创 2021-09-12 14:06:03 · 74 阅读 · 0 评论 -
07-多环境配置及配置文件位置
多环境配置及配置文件位置application.yml优先级优先级顺序(最简单的端口号测试)多环境配置用 " — "来区别各个环境原创 2021-09-12 14:04:31 · 65 阅读 · 0 评论 -
06-JSR303校验
JSR303校验原创 2021-09-12 14:03:36 · 80 阅读 · 0 评论 -
05-yaml给实体类赋值
yaml给实体类复制准备工作pojoDog//@Component为了更容易被扫描@Componentpublic class Dog { private String name; private Integer age;//有参无参 setter getter toString}Person@Component//@ConfigurationProperties(prefix = "person") 相当于绑定了application.yaml里面的person/原创 2021-09-09 23:37:55 · 201 阅读 · 0 评论 -
04-yaml语法讲解
yaml语法讲解application.properties删掉官方推荐application.yamlyaml语法(注意空格)#properties只能保存键值对!#key=value# server.port=8081#对象student.name=张三student.age=18# yaml语法# 对空格的要求十分高server: port: 8081#key: valuestudent: name: 张三 age: 18#行内写法stude原创 2021-09-09 23:36:38 · 91 阅读 · 0 评论