摘要:
1.全局异常处理: @ControllerAdvice处理全局数据,一般搭配@ExceptionHandler,@ModelAttribute以及@InitBinder使用。 @ControllerAdvice public class CustomExceptionHandler { @Excep
阅读全文
posted @ 2020-02-16 16:20
MyBeans
阅读(460)
推荐(0)
编辑
摘要:
文件上传: Java中文件上传一共涉及到两个组件,CommonsMultipartResolver和StandardServletMultipartResolver,其中CommonsMultipartResolver使用commons-fileupload来处理multipart请求,Standa
阅读全文
posted @ 2020-02-16 15:19
MyBeans
阅读(685)
推荐(0)
编辑
摘要:
1.默认策略: 静态资源的位置一共5个,开发者可以将静态资源放到其中任意一个,分别是: "classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"
阅读全文
posted @ 2020-02-16 14:41
MyBeans
阅读(416)
推荐(0)
编辑