我传入requestparam一个值,例如“fré使“它变成”frã©问“请问我怎样才能解决这个问题?”。
这是我的代码和运行它的异常
@RequestMapping(value = "{subfamilyId}/docs", method = RequestMethod.GET, consumes="charset=utf-8")
public void series(@PathVariable("subfamilyId") String subfamilyId,
@RequestParam(value = "columns", required = false) String columns,
@RequestParam(value = "searchedValues", required = false) String searchedValues,
@RequestParam(value = "excludedValues", required = false) String excludedValues,
@RequestParam(value = "format", required = false, defaultValue = "csv") String format,
@RequestParam(value = "pretty", required = false) boolean pretty,
@RequestParam(value = "size", required = false, defaultValue = "100") int size,
@RequestParam(value = "scroll_id", required = false) String scrollId,
HttpServletResponse response) throws Exception {}
我得到一个例外:
Caused by: org.springframework.util.InvalidMimeTypeException: Invalid mime type "charset=utf-8": does not contain '/'
at org.springframework.util.MimeTypeUtils.parseMimeType(MimeTypeUtils.java:231) [spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.http.MediaType.parseMediaType(MediaType.java:382) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
... 48 more
你能帮帮我吗?
1条答案
按热度按时间mwecs4sa1#
您应该先指定媒体类型