
springboot
魏 无羡
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
阿里云发送短信验证码
阿里云发送短信验证码 官网文档地址:https://help.aliyun.com/document_detail/55284.html?spm=a2c4g.11186623.6.671.1a20310fZsaKdL maven依赖 <dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-core</artifactId> <version&转载 2021-01-07 09:29:03 · 191 阅读 · 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 · 220 阅读 · 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 · 141 阅读 · 0 评论 -
springboot自定义异常 全局异常信息
1:自定义异常 项目中经常有一些异常信息需要抛出,这个时候有可能就需要我们自定义一个异常类来获取信息,返回给前台,我们只需要创建一个类去继承异常类,就实现了自定义的异常类.如下 @Data @AllArgsConstructor @NoArgsConstructor public class MyException extends RuntimeException{ private String code; //异常状态码 private String message; //异常信息原创 2020-11-23 10:23:09 · 247 阅读 · 0 评论 -
boot拦截器 问题
1: 自定义拦截器中的postHandle方法中的 ModelAndView一直报null指针问题 原因 在控制成用RestController,这个意思默认添加了ResponseBody,就没有ModelAndView,可以把RestController改成Controller,就可以拿的到ModelAndView这个对象 2:自定义拦截器中,自动注入为null 原因 需要在拦截器的配置中,将自定义的拦截器定义为一个bean @Configuration public class MyWebAppConf原创 2020-11-22 22:53:18 · 371 阅读 · 0 评论 -
springboot自定义 404 500错误页面
springboot自定义 404 500错误页面 1:使用thymeleaf模板 使用thymeleaf模板的时候,boot会先到==/resources/templates/error/==文件夹下找自定义错误的页面 错误页面命名规则:错误码.html 2: 没有使用thymeleaf模板 没有使用thymeleaf模板的时候,会去静态资源==/static/error==寻找404.htm、500.html的错误提示页面, 3: 自定义错误页面 错误代码的类型很多,如400、403、404等等,如果按原创 2020-11-16 10:22:31 · 1114 阅读 · 0 评论 -
springboot 拦截器
springboot拦截器 直接实战 pom依赖 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <原创 2020-11-15 09:26:05 · 141 阅读 · 0 评论 -
springboot 整合 redis
springboot 整合 redis 1:导入依赖 <!-- Spring Boot redis 依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactI原创 2020-09-30 09:33:09 · 358 阅读 · 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 · 167 阅读 · 0 评论 -
springboot上传文件大小限制
1: springboot默认的文件大小限制是1M 2: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 · 2454 阅读 · 0 评论