一、ajax请求,返回ModelAndView对象,结果报404:
@RequestMapping(value = "/video") public ModelAndView jj() { // MappingJackson2JsonView——modul转成json ModelAndView mv = new ModelAndView(); mv.addObject("message", "视频上传成功"); mv.addObject("status", "1"); mv.addObject("videoUrl", "caiji"); System.out.println(000); return mv; }
二、解决方法:利用MappingJackson2JsonView把model转成json
ModelAndView mv = new ModelAndView(new MappingJackson2JsonView());