08 2021 档案
Content type ‘multipart/form-data;boundary=--------------------------9107
摘要:PostMapping请求,同时接收实体类、String参数、File文件 报错 415 或 Content type 'multipart/form-data;boundary 9107 经过半个小时的查找,改Content-Type改传值方式改@RequestBody 改@Param 改@Req
阅读全文
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;bounda
摘要:最近在做一个图片上传,遇到这了这种情况,在入参 body 中同时传入文件和其它参数信息结果出现如题异常。 特别在此记录解决办法,以供大家参考。 @PostMapping("/app")public ResponseEntity<Integer> createApplication(@RequestB
阅读全文
org.hibernate.LazyInitializationException: could not initialize proxy 解决方案(JPA)
摘要:错误信息:org.hibernate.LazyInitializationException: could not initialize proxy 原因:在根据 Id 获取对象中使用了 getOne() 方法 解决方案: 1. 如果使用 JPA 时使用了 getOne() 方法就会报这个懒加载异常
阅读全文
GitLab代码回滚到特定版本
摘要:在当前branch上多次commit代码并且push后,发现不符合要求,需要回滚到特定的版本。步骤如下: 0、进入项目在本地的目录路径,打开gitLab的命令客户端。 1、查找commitId (1)用命令行打开git项目路径,输入git log命令查看commit记录,如下: $ git log
阅读全文