1、在做文件上传时碰到了一个问题,如下:

org.springframework.web.multipart.MultipartFile]: Specified class is an interface

在使用注解开发时常犯的错误以及常见情况

 

解决的办法就是:

在controller层接收文件的前面加上@RequestParam

之前:

在使用注解开发时常犯的错误以及常见情况

 

之后:

 在使用注解开发时常犯的错误以及常见情况

 2、出现404页面

在使用注解开发时常犯的错误以及常见情况

   一般是没写@ResponseBody注解

 

3、java.lang.IllegalStateException: Optional long parameter 'id' is not present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

 一般是没写@PathVariable出现的错误

 

相关文章:

  • 2022-02-28
  • 2021-08-24
  • 2021-11-28
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2021-06-29
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2021-04-09
  • 2021-06-04
  • 2021-12-18
相关资源
相似解决方案