I'm new to jquery and SpringMVC. I'm using jquery to submit a request after a user clicks a href. After the server processes the request, a modal popup is displayed with the details from the server.
$.post(taskSrchURL, function(data) {
$('#popupmodal').modal('show');
});
Here is the Controller:
@RequestMapping(value = "/api/task/{id}", method =
{RequestMethod.POST})
public ModelAndView searchDetails(@PathVariable("id") String
id,
HttpServletRequest request, HttpServletResponse response)
throws SearchException, ApplicationException {
Details details = service.getDetails(id, request, response);
prepareResponse(request, response, taskDetails);
ModelAndView modelAndView = new ModelAndView("details ");
modelAndView.addObject("details ", details);
return modelAndView;
I'm expecting to have access to the "details" object when the response returns, however, I'm not sure how to access it. I'm expecting to be able to use jstl tags to reference the data as it is complex and needs to be dispalyed on several tabs.
However,
<c:out value="${details.id}"/>
does not work. I have seen a lot examples that set the 'data' from the ModalAndView to the html element of a div, but I don't want to do that.
Is there a way to do this?
Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire