Is it possible to have a Spring controller return JSON formatted data instead of a physical view (jsp file)? All of the interfaces I have seen require you to return a ModelAndView. I could achieve what I want to by using plain servlets but I'd like to take advantage of Spring's IOC features.
Joined: Aug 15, 2004
Here is the example code snippet using json-simple.jar,
You can return just a String, you can return null, you can return a View technology object like say JstlView, and also you can just return an object that is the Model, it doesn't always have to be a ModelAndView object.