这是在spring4之后。
@RequestMapping(value = "/returnjson") public ModelAndView getfsd(){ ModelAndView modelAndView=new ModelAndView(new MappingJackson2JsonView()); modelAndView.addObject("result","success"); return modelAndView; }