带有JSON的Spring MVC分段请求
我想使用Spring MVC发布带有一些JSON数据的文件。因此,我开发了一种休息服务 @RequestMapping(value = "/servicegenerator/wsdl", method = RequestMethod.POST,consumes = { "multipart/mixed", "multipart/form-data" }) @ResponseBody public String generateWSDLService(@RequestPart("meta-data") WSDLInfo wsdlInfo,@RequestPart("file") MultipartFile file) throws WSDLException, IOException, JAXBException, ParserConfigurationException, SAXException, TransformerException { return handleWSDL(wsdlInfo,file); } 当我从其他客户端发送请求时 content-Type = multipart/form-data or multipart/mixed,出现下一个异常: org.springframework.web.multipart.support.MissingServletRequestPartException 谁能帮助我解决这个问题? 我可以@RequestPart同时将Multipart和JSON发送到服务器吗?