I am currently using the Spring MVC, and I am trying to do some stuff with ajax. Basically what I want to do now is display the result from a controller dynamically on a webpage.
I.E. A user pushes a button it goes to the “whatever.do” controller and gets a list and displays that list without having to reload that page.
Anyway does anyone know any good tutorials or example projects?
It is very simple, I don’t even think a special tutorial is needed (apart from a generic spring-mvc one).
@RequestMapping("/foo")method that returns aList<Foo><mvc:annotation-driven />in yourdispatcher-servlet.xmlto activate handler mappings and convertors$.getJSON("/foo", function(data) {..});(jquery) – you will get a JSON-encoded list of yourFooobjectsSpring will detect that the browser requests a json response, and converts your objects using Jackson.