摘要:
ErrorMvcAutoConfiguration 自动配置异常处理规则 容器中的组件:类型:DefaultErrorAttributes -> id:errorAttributes public class DefaultErrorAttributes implements ErrorAttrib 阅读全文
posted @ 2022-09-12 05:11
咖喱给给啊
阅读(50)
评论(0)
推荐(0)
摘要:
1、错误处理 默认情况下,Spring Boot提供/error处理所有错误的映射 对于机器客户端,它将生成JSON响应,其中包含错误,HTTP状态和异常消息的详细信息。对于浏览器客户端,响应一个“ whitelabel”错误视图,以HTML格式呈现相同的数据 要对其进行自定义,添加View解析为e 阅读全文
posted @ 2022-09-12 04:31
咖喱给给啊
阅读(30)
评论(0)
推荐(0)
摘要:
文件上传自动配置类-MultipartAutoConfiguration-MultipartProperties 自动配置好了 StandardServletMultipartResolver 【文件上传解析器】 原理步骤 1、请求进来使用文件上传解析器判断(isMultipart)并封装(reso 阅读全文
posted @ 2022-09-12 03:55
咖喱给给啊
阅读(60)
评论(0)
推荐(0)
摘要:
1、页面表单 <form method="post" action="/upload" enctype="multipart/form-data"> <input type="file" name="file"><br> <input type="submit" value="提交"> </form 阅读全文
posted @ 2022-09-12 03:05
咖喱给给啊
阅读(16)
评论(0)
推荐(0)
摘要:
1.执行prehandle1方法 如果返回为true 就继续执行 prehandle2方法 prehandle2方法如果返回为true 就继续执行prehandle3方法 如果 prehandle3方法返回true 就倒叙执行 posthandle3 然后posthandle2 然后posthand 阅读全文
posted @ 2022-09-12 02:41
咖喱给给啊
阅读(412)
评论(0)
推荐(0)
摘要:
//HandlerInterceptor 直接重写接口方法就能实现拦截 /** * 登录检查 * 1、配置好拦截器要拦截哪些请求 * 2、把这些配置放在容器中 */ @Slf4j public class LoginInterceptor implements HandlerInterceptor 阅读全文
posted @ 2022-09-12 01:57
咖喱给给啊
阅读(55)
评论(0)
推荐(0)
摘要:
@Configuration + @WebMvcConfigurer 自定义规则 比如自定义拦截器 阅读全文
posted @ 2022-09-12 01:57
咖喱给给啊
阅读(5)
评论(0)
推荐(0)
浙公网安备 33010602011771号