@Override@POST@Consumes(MediaType.MULTIPART_FORM_DATA)@Path("/uploadFile")publicvoidupdateFile(@ContextHttpServletRequestrequest){booleanisMultipart=ServletFileUpload.isMultipartContent(request);if(isMultipart){FileItemFactoryfactory=newDiskFileItemFactory();ServletFileUploadupload=newServletFileUpload(factory);upload.setHeaderEncoding("UTF-8");List<FileItem>list=null;try{list=upload.parseRequest(request);for(FileItemfile:list){if(file.isFormField()){//普通表单值System.out.println(file.getString());//TODO}else{StringfileName=file.getName();System.out.println(fileName);InputStreaminput=file.getInputStream();//TODO进行一些文件上传操作}}}catch(FileUploadExceptione){// TODO Auto-generated catch blocke.printStackTrace();}}}