有没有区别
@ResponseBody
public Object method(etc..) {
etc..
}
和
public @ResponseBody Object method(etc..){
etc..
}
?
有没有区别
@ResponseBody
public Object method(etc..) {
etc..
}
和
public @ResponseBody Object method(etc..){
etc..
}
?
它们之间没有区别。
如果该方法使用 @ResponseBody 注释,则返回类型将写入响应 HTTP 正文。返回值将使用 HttpMessageConverters 转换为声明的方法参数类型
http://static.springsource.org/spring/docs/3.0.x/reference/mvc.html#mvc-ann-responsebody