I'm using Spring MVC, and I need return in the Controller, a Json object that contains the view, by example, the related jsp page.
return: { name: "fragment-form", other-info:"other-info", view: view}
where "view" should be the JSP page linked to your ModelAndView
I read other post, but I not find the solution, because I need that controller to the work, if it's posible.
Sugestions?
EDIT:
I have a form with your values, and the submit, from javascript execute this follow code:
@RequestMapping(method = RequestMethod.POST)
public Object create(@Valid @RequestBody PatientForm form, HttpServletResponse response) {
ModelMap map = new ModelMap();
map.put("form", form);
return new ModelAndView("addPatientForm", map);
}
I need return a Json where the "ModelAndView("addPatientForm", map)" processed within the json that is returned.
HOLA
"} where "HOLA
" is my JSP view. – Cristian Rinaldi Apr 26 '12 at 12:13