Dec 27th, 2011, 04:59 PM
How to pass json to js function
I want to use the jquery datatables plugin along with Spring 3.1/json. I'm not sure the correct way to pass the data from the jsp page to the js function which will initialize the grid.
Any advice would be greatly appreciated.
Dec 28th, 2011, 05:08 AM
in my opinion you should convert your object to JSON in the controller, provide via ViewModel and then parse with JQuery. Another approach valid for the long run (support filtering/paging without reloading the whole page again), would be rendering the JSP page and asynchronously loading the data afterwards. Then you could use the ContentNegotiationViewResolver and override the view twice like this: http://stackoverflow.com/questions/3...ing-on-request
Tags for this Thread