我是RESTful服务及其在Spring 3上的实现的新手。我希望您的意见能够在客户端在我的服务器中创建新资源时返回类型的最佳实践。Spring 3 RESTful返回POST(创建)
@RequestMapping(method = RequestMethod.POST,
value = "/organisation",
headers = "content-type=application/xml")
@ResponseStatus(HttpStatus.CREATED)
public ??? createOrganisation(@RequestBody String xml)
{
StreamSource source = new StreamSource(new StringReader(xml));
Organisation organisation = (Organisation) castorMarshaller.unmarshal(source);
// save
return ???;
}
这将帮助http://stackoverflow.com/questions/12837907/what-to-return-if-spring-mvc-controller-method-doesnt-return-value – Xiangyu 2015-08-24 09:35:02