- 博客(23)
- 收藏
- 关注
原创 大白话JAVA中的动态代理
1、何为代理模式代理模式是一种设计模式。有点像中介,代替房东直接面对租户或者某些代理商,代替厂家对接客户。简单来说就是使用代理对象来代替真实对象的一系列操作,这样的好处可以在不修改原目标对象的前提下,提供额外的功能操作,扩展目标对象的功能。代理模式的主要作用是扩展目标对象的功能,比如说在目标对象的某个方法执行前后你可以增加一些自定义的操作。......
2022-04-16 23:15:39
845
原创 java.lang.IllegalStateException: No thread-bound request found 解决方法
No thread-bound request found: " + "Are you referring to request attributes outside of an actual web request, " + "or processing a request outside of the originally receiving thread?
2022-03-09 10:53:12
16011
2
原创 try(){} catch(try-with-resources)
try-with-resources主要想讲的介玩意儿叫try-with-resources,跟JDK版本有关1、首先在JDK1.7之前,必须在finally块中手动关闭资源,否则会导致资源的泄露。/** * JDK 1.7之前 * 完整的进行try-catch形式捕获 * 必须在finally块中手动关闭资源 * * @author gary */@Slf4jpublic class TryCatchDemo { public static String download(
2021-12-29 11:30:40
395
原创 springboot 以IO流形式返回给前端
1、Controller@ApiOperation(value = "IO流返回给前端")@GetMapping("fileView")public void fileView(@ApiParam(value = "文件路径", required = true) @RequestParam String fileUrl, HttpServletResponse response) { fileService.fileView(fileUrl, response);}2、Service
2021-12-29 11:17:11
4694
原创 对象嵌套list子对象,一个SQL解决
对象嵌套list返回,一般需要写两个SQL重复循环查询,看看只需要一个SQL的写法吧!1、Resp{ "code": "20000", "data": { "A": "YOUR", "B": "SO", "C": "BEAUTIFUL", "D": "I", "list": [ { "E": "haha", "F": "good job" }, { "E": "bill.
2021-11-18 10:01:52
1958
1
原创 SpringBoot 文件(图片示例)上传
SpringBoot 文件上传1、application.yml 配置2、Controller3、Impl1、application.yml 配置spring: mvc: # url访问文件路径 static-path-pattern: /** web: resources: # 用于描述(静态)资源的存放位置 多个路径(逗号隔开)中依次查找是否存在 static-locations: classpath:/ ,file:/ servlet:
2021-05-11 14:38:18
206
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人