![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
文章平均质量分 69
跳着迪斯科学Java
已转iOS
展开
-
Spring boot上传文件(图片)到阿里云OSS(直接上传到应用服务器)
Spring boot上传文件(图片)到阿里云OSS(直接上传到应用服务器)主要思路上传图片的思路有两种:第一种是上传到应用服务器,再由应用服务器上传到OSS。这种适合上传的文件较小,较为简单,但文件过大会造成服务器压力变大。第二种是利用签名直传的方式,较为复杂,但能减轻服务器的压力。直接上传到应用服务器的方式0.导入依赖除去常规的依赖还需要以下依赖: <dependency> <groupId>com.aliyun.oss&原创 2021-04-27 22:11:42 · 2560 阅读 · 1 评论 -
Spring boot集成Swagger3
一、导入依赖这里以springfox来使用:SpringFox是 spring 社区维护的一个项目(非官方),帮助使用者将 swagger2 集成到 Spring 中。常常用于 Spring 中帮助开发者生成文档,并可以轻松的在spring boot中使用。swagger3只需要导入一个依赖: <dependency> <groupId>io.springfox</groupId> <artifactI原创 2021-04-12 17:10:13 · 5856 阅读 · 1 评论 -
Spring boot(6) 数据访问
Spring boot(6) 数据访问学习视频:https://www.bilibili.com/video/BV19K4y1L7MT?p=62&spm_id_from=pageDriver1.数据源的自动配置-HikariDataSource1.1 导入JDBC场景 <dependency> <groupId>org.springframework.boot</groupId> <a原创 2021-04-11 20:36:41 · 159 阅读 · 0 评论 -
Spring Boot(5) web开发(3)拦截器、文件上传、异常处理
Spring Boot(5) web开发(3)拦截器、文件上传、异常处理学习视频: https://www.bilibili.com/video/BV19K4y1L7MT?p=49&spm_id_from=pageDriver1.拦截器拦截器的三个位置:1.1 实现Interceptor接口/** * @ClassName LoginIntercepor * @Description TODO * @Author deserts * @Date 2021/4/2 10:28原创 2021-04-08 14:35:11 · 167 阅读 · 0 评论 -
springboot 2.4.4java.sql.SQLException Access denied for user ‘root‘@‘localhost‘ (using password YES)
springboot 2.4.4测试java.sql.SQLException: Access denied for user ‘root’@‘localhost’ (using password: YES)报错报错1:报错2:报错1的内部原因是报错2,原因是yml配置文件错误,配置密码是没有加上引号spring: datasource: url: jdbc:mysql://localhost:3306/bookstore username: root passwor原创 2021-04-06 18:18:09 · 144 阅读 · 0 评论 -
Spring boot(4) web开发(2) 请求处理、响应处理、模板引擎
Spring boot(4) web开发(2) 请求处理、响应处理、模板引擎参照教程:https://www.bilibili.com/video/BV19K4y1L7MT1.请求映射1.1 rest使用与原理1.1.1 使用Rest风格支持(使用HTTP请求方式动词来表示对资源的操作)以前:/getUser 获取用户 /deleteUser 删除用户 /editUser 修改用户 /saveUser 保存用户现在: /user GET-获取用户 DELE原创 2021-04-02 16:11:38 · 311 阅读 · 0 评论 -
fonts.googleapis.com加载过慢导致的项目启动过慢的问题
fonts.googleapis.com加载过慢导致的项目启动过慢的问题导入练习项目后发现浏览器加载过慢,一直以为是浏览器缓存问题,结果设置后还是很慢:Spring boot 2.4开启静态资源缓存,最后发现是访问谷歌字体库访问不了,国内有墙,所以想用得下到本地,然后改为本地地址这里只是作为练习,发现360的字体库也用不了,这里就直接注释掉了影响不大,清掉浏览器缓存重新访问就好了总结:以后遇到这种访问的问题应该先看浏览器调试台...原创 2021-04-01 19:31:13 · 444 阅读 · 5 评论 -
Spring boot 2.4开启静态资源缓存
Spring boot 2.4开启静态资源缓存yml配置:spring: web: resources: cache: cachecontrol: no-store: false max-age: 10000 no-cache: false参数含义:参考博客:浏览器缓存设置原创 2021-03-30 22:17:00 · 978 阅读 · 0 评论 -
Spring Boot(3) Web开发(1)静态资源处理
Spring Boot(3) Web开发(1)静态资源处理基于spring boot 2.4.3版本1.静态资源访问1.1 静态资源目录把静态资源放在类路径下的以下目录:/static; /public; /resources; /META-INF/resources;这些目录作为这些静态资源的根目录,如输入http://localhost:8080/4.jpg可直接访问过程:请求进来,先去找Controller看能不能处理。不能处理的所有请求又都交给静态资源处理器。静态资源也找不到则响应4原创 2021-03-26 16:45:20 · 710 阅读 · 0 评论 -
Spring boot启动The ApplicationContext could not start that is generat
Spring boot启动出现The ApplicationContext could not start as ‘org.springframework.aot.StaticSpringFactories’ that is generated by the Spring AOT plugin could not be found.错误原因:web模块没有加入,加载失败解决:创建项目时加入web模块,即可启动成功可启动成功...原创 2021-03-26 16:44:01 · 4123 阅读 · 10 评论 -
Spring Boot(2) 配置文件
Spring Boot(2) 配置文件学习视频:https://www.bilibili.com/video/BV19K4y1L7MT?p=201.properties语法:同以前的properties用法2.yml2.1 简介AML 是 “YAML Ain’t Markup Language”(YAML 不是一种标记语言)的递归缩写。在开发的这种语言时,YAML 的意思其实是:“Yet Another Markup Language”(仍是一种标记语言)。非常适合用来做以数据为中心的配原创 2021-03-23 23:46:34 · 74 阅读 · 0 评论 -
Spring Boot(1) 入门、自动配置
Hello,Spring Boot1.创建一个普通的maven项目2.pom.xml引入依赖<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.4.RELEASE</version>原创 2021-03-21 23:46:10 · 80 阅读 · 0 评论