![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
魏 无羡
这个作者很懒,什么都没留下…
展开
-
阿里云发送短信验证码
阿里云发送短信验证码官网文档地址:https://help.aliyun.com/document_detail/55284.html?spm=a2c4g.11186623.6.671.1a20310fZsaKdLmaven依赖<dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-core</artifactId> <version&转载 2021-01-07 09:29:03 · 118 阅读 · 0 评论 -
springmvc 乱码问题
乱码问题处理方法1、修改tomcat配置文件server.xml :设置编码!<Connector URIEncoding="utf-8" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />2、使用springmvc提供的处理乱码的过滤器<!--mvc提供的 过滤器处理乱码问题--><filter> .原创 2020-12-07 10:15:08 · 157 阅读 · 0 评论 -
springmvc配置文件
springmvc配置文件web.xml<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http:原创 2020-12-07 09:52:39 · 101 阅读 · 0 评论 -
springboot自定义异常 全局异常信息
1:自定义异常项目中经常有一些异常信息需要抛出,这个时候有可能就需要我们自定义一个异常类来获取信息,返回给前台,我们只需要创建一个类去继承异常类,就实现了自定义的异常类.如下@Data@AllArgsConstructor@NoArgsConstructorpublic class MyException extends RuntimeException{ private String code; //异常状态码 private String message; //异常信息原创 2020-11-23 10:23:09 · 189 阅读 · 0 评论 -
boot拦截器 问题
1: 自定义拦截器中的postHandle方法中的 ModelAndView一直报null指针问题原因在控制成用RestController,这个意思默认添加了ResponseBody,就没有ModelAndView,可以把RestController改成Controller,就可以拿的到ModelAndView这个对象2:自定义拦截器中,自动注入为null原因需要在拦截器的配置中,将自定义的拦截器定义为一个bean@Configurationpublic class MyWebAppConf原创 2020-11-22 22:53:18 · 240 阅读 · 0 评论 -
springboot自定义 404 500错误页面
springboot自定义 404 500错误页面1:使用thymeleaf模板使用thymeleaf模板的时候,boot会先到==/resources/templates/error/==文件夹下找自定义错误的页面错误页面命名规则:错误码.html2: 没有使用thymeleaf模板没有使用thymeleaf模板的时候,会去静态资源==/static/error==寻找404.htm、500.html的错误提示页面,3: 自定义错误页面错误代码的类型很多,如400、403、404等等,如果按原创 2020-11-16 10:22:31 · 990 阅读 · 0 评论 -
springboot 拦截器
springboot拦截器直接实战pom依赖<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <原创 2020-11-15 09:26:05 · 98 阅读 · 0 评论 -
springboot 整合 redis
springboot 整合 redis1:导入依赖 <!-- Spring Boot redis 依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactI原创 2020-09-30 09:33:09 · 280 阅读 · 0 评论 -
springboot创建的方式
1: 有三种方式创建springboot项目1) 通过IDEA或者Eclipse的Spring Initializer创建.2) 访问 http://start.spring.io/ 创建SpringBoot的骨架.3) 自己手动搭建.2 第一种方式打开idea工具 ,点击 create new project点击完成出现点击启动类控制台出现下面这句,表示启动成功可以再浏览器中...原创 2020-04-18 15:27:27 · 108 阅读 · 0 评论 -
springboot上传文件大小限制
1: springboot默认的文件大小限制是1M2:1.5.x 的版本和 2.x 的版本设置是不一样的1.5.x的版本,,在resources下的application.properties文件,如果是yml的方式,那文件就是application.yml。我这边以application.yml文件为例spring: http: multipart: max-req...原创 2020-03-23 14:28:13 · 2256 阅读 · 0 评论