java.lang.NullPointerException while creating DiskFileItem

前端 未结 5 1635
我寻月下人不归
我寻月下人不归 2021-01-13 04:14

I am trying to write a unit test for handling a file upload controller using Spring 3. Now if I send the image over to my service method through the controller everything wo

5条回答
  •  半阙折子戏
    2021-01-13 05:10

    new DiskFileItem(fieldName, contentType, isFormField, fileName, sizeThreshold, file);
    

    results in a null value. Look into the docs to see what's wrong or maybe you pass some null as parameters

提交回复
热议问题