Background Error:org.springframework.web.multipart.support.MissingServletRequestPartException: Required request part ‘file_data’ is not present
Reason:The front and backend parameters do not match, the frontend does not have the parameter file_data
@RequestMapping(value = “/importDept”, method = RequestMethod.POST)
@ResponseBody
public AjaxResult importDept(@RequestParam(value = “file_data”) MultipartFile file,
HttpServletRequest request) throws ParseException {
@RequestMapping(value = “/importDept”, method = RequestMethod.POST)
@ResponseBody
public AjaxResult importDept(@RequestParam(value = “file_data”) MultipartFile file,
HttpServletRequest request) throws ParseException {
…..
}
Similar Posts:
- Spring Cloud Openfeign Get Request 405 Error [How to Solve]
- The interface method is not rewritten, and the idea does not report an error.
- [Solved] Using JDK dynamic agent to customize SPI Error: UndeclaredThrowableException
- [Solved] Error resolving template “XXX”, template might not exist or might not be accessible by any of the
- [Solved] Sping controller Receives list entity parameter Error: nested exception is java.lang.IndexOutOfBoundsException: Index: 256, Size: 256
- How to Solve Error: Required request body is missing
- [Solved] oauth2(spring security) Error: method_not_allowed(Request method ‘GET’ not supported)
- [Solved] Oauth2(spring security)method_not_allowed(Request method ‘GET’ not supported)
- [Solved] No converter found for return value of type: class org.json.JSONObject
- SpringMvc Error:java.lang.IllegalStateException