spring mvc返回json字符串数据,只需要返回一个java bean对象就行,只要这个java bean 对象实现了序列化serializeable

1.spring mvc返回json数据,只需要返回一个java bean对象就行,只要这个java bean 对象实现了序列化serializeable

2.

@RequestMapping(value = { "/actor_details" }, method = { RequestMethod.POST })
@ResponseBody
public ResultObject actorDetails(@RequestBody ActorDetailsRequest req) {
logger.debug("查看{}主播信息", req.getAid());
if (req.getAid() == null || req.getAid().equals("null")
|| req.getAid().equals("")) {
return new ResultObject(ResultCode.NULL_PARAM);
}
ActorAndUser result = actorServiceImpl.queryActorData(req.getAid());
return new ResultObject(result);
}
上一篇:spring 3 mvc hello world + mavern +jetty


下一篇:2018-8-10-win10-uwp-依赖属性