Java 代码
@RequestMapping(value="/test/requestBody",method=Re
questMethod.POST) @ResponseBody public
Map<String,Object> testrequestBody(@RequestBody
Map<String,Object>
map1){ Map<String,Object> map=new
HashMap<String,Object>();
map.put("name","lg"); map.put("age",23);
map.put("date",new Date()); return map; }
HttpEntityMethodProcessor 具体的解析参数的过程:
Java 代码 @Override public Object
resolveArgument(MethodParameter parameter,
ModelAndViewContainer mavContainer,
NativeWebRequest webRequest, WebDataBinderFactory
binderFactory) throws IOException,
HttpMediaTypeNotSupportedException
{ HttpInputMessage inputMessage =
createInputMessage(webRequest); Type
paramType = getHttpEntityType(parameter);
评论0
最新资源