For this to work correctly, you must be sure to use AnnotationMethodHandlerAdapter . This overrides HandlerMethodInvoker createHttpInputMessage (which throws the exception you see). (This is done in a private class.)
I believe you can simply include the following in your * -servlet.xml
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
. @RequestBody @RequestParam . , -.
, Spring 3.0.1. , . @RequestBody @RequestParam. , , HandlerMethodInvoker ( GET) ( ).
(: Scala, Java-)
@RequestMapping(value = "/test", method = RequestMethod.POST)
public String test(
@RequestBody String body,
@RequestParam("param1") String parma1,
Map<Object, Object> model: Map[AnyRef, AnyRef])
{
model.put("test", test)
model.put("body", body)
return "Layout"
}
@PathVariable. , .