在ajax调用的响应中返回实体而不是VO时是否存在任何问题(安全性,一致性,不良实践等)?
小例子:
JAVA:
@RequestMapping(method = RequestMethod.POST, value = "loadSomething.do")
public @ResponseBody RealEntity loadSomething(){
return service.getRealEntity();
}
JavaScript的:
$.ajax({
type:'POST',
url: rquestURL,
cache: false,
success: function(realEntity) {
doSomething(realEntity);
}});