我正在制作一个使用女岛的超载文件索引。
@Path("/api")
public class GreetingService {
@POST
@Path("/upload")
@Consumes("multipart/form-data")
//@Produces("text/plain")
public String uploadFile(@FormParam("file") File file, @FormParam("file") FormDataContentDisposition fcdsFile) {
String fileLocation = "/files/" + fcdsFile.getFileName();
//File destFile = new File(fileLocation);
return "1";
} }
When I do curl -v -X POST --form [email protected] url I get
SEVERE: Servlet.service() for servlet ServletAdaptor threw exception
java.lang.NullPointerException for this line String fileLocation = "/files/" + fcdsFile.getFileName();
哪里会错?