Why when i return a ModelAndView in a call ajax it works and display the jsp page normally but when when i return it into a map with other object it doesn't work.
First case which work:
@RequestMapping(value="/searchlostcard")
public @ResponseBody
ModelAndView searchlostcard() {
[...]
return new ModelAndView("search/results","cardlist", listlostcard); ;
}
My ajax call
[...]
success : function(responce) {
$('#page_grid').html(responce);
}
Second case which doesn't work:
@RequestMapping(value="/searchlostcard")
public @ResponseBody
Map<String, Object> searchlostcard() {
[...]
ModelAndView MaV = new ModelAndView("search/results","cardlist", listlostcard);
Map<String, Object> modelino = new HashMap<String, Object>();
modelino.put("taille", listlostcard.size());
modelino.put("vue", MaV);
return modelino ;
}
My ajax call
[...]
success : function(responce) {
$('#page_grid').html(responce['vue']);
}