Hi, am trying to get a List of an object as a json view from my controller, but somehow its not working at all : here is my controller :
its supposed to return a list of mails as a json view.PHP Code:@RequestMapping(value = "ajaxLoad", method = RequestMethod.GET)
public @ResponseBody List<Mail> list(@RequestParam(value = "type", required = true) String type){
List<Mail> mails = mailService.getUserMails((Long) WebHelper.getPrincipal().getUser().getId(),type);
return mails;
}
but i got errors : l it s trying to redired to the view ajaxLoad.jsp which doesnt exists.
i have added the jackson json library in my app.
In the Keith Donald tutorials, he said that "Underneath the covers, Spring MVC delegates to a HttpMessageConverter to perform the serialization. In this case, Spring MVC invokes a MappingJacksonHttpMessageConverter built on the Jackson JSON processor. This implementation is enabled automatically when you use the mvc:annotation-driven configuration element with Jackson present in your classpath."
What if am not using the mvc:annotation, how to implement it manually?
thanks for any adivse




Reply With Quote
