Could use some assistance with the following:
I am working on a function that is supposed to return two different entities, one as a return value and the other as a model. The return can be read, but the model cannot.
$('.thumbnail').click(function(event){
var id=($(this).data("targetelement"));
var url='getphotos/'+id;
$.get(url,function(data, textStatus, jqXHR){
/*<![CDATA[*/
var product = /*[[${message}]]*/
/*]]>*/
console.log(product);
});
});
This controller looks like this:
@GetMapping(value = "getphotos/{id}")
public @ResponseBody ArrayList<Gallery> getPhotos(@PathVariable int id, Model model, HttpServletRequest req) {
Product pro=service.getProduct(id);
model.addAttribute("pro", pro);
return service.getphotos(id);
}