Search code examples
springmodel-view-controlleryui

sending json object from spring mvc controller to yui view


I want to send a json object from spring mvc controller to a view since I have YUI data table and I want the json object to be the data source for this table. any advise or example close to this case will be appreciated :)


Solution

  • You can use the Jackson converter and @ResponseBody annotation:

    @RequestMapping(...)  
    public @ResponseBody Json getJson(){ 
        return new Json();
    }
    

    Follow these instructions.