I am using spring MVC
I have a method
@RequestMapping(value = "/firstMethod/getDetails", method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> getFirstMethodDetails(HttpServletRequest request,
HttpServletResponse response) {
Map<String, Object> model = new HashMap<String, Object>();
model.put("name", "Bryan");
request.getRequestDispatcher("/secondmethod/getDetails")
.include(request, response);
// want to access second methods model values here
return model;
}
From which i am including a request to another method
@RequestMapping(value = "/secondMethod/getDetails", method=RequestMethod.GET)
@ResponseBody
public Map<String, Object> getSecondMethodDetails(HttpServletRequest request,
HttpServletResponse response) {
Map<String, Object> model = new HashMap<String, Object>();
model.put("age", 29);
return model;
}
Now how to access the model of second method from first method??