This solution does not work for a nested map. I'm trying to convert to JSON. I need to send this nested map because it contains a lot that I need for a graph which I'm going to make with plotly on the frontend.
This is what the nestedMap looks like on the backend:
Map<String, Map<String, Object>> nestedMap
Although after I passed it to the controller, I declared it as def nestedMap
before I tried to render it. At the end of the controller I tried render nestedMap
as JSON.
What I receive after my AJAX call:
{"FirstSample":
{"S1":
{"avg":2.367333,"computation":-7.314434,"computedAvg":9.26567,"this$0":
{"transactionManager:
{"class":"org.codehaus.groovy.grails.transaction.ChainedTransactionManager",
"transactionManagers":[
{"dataSource":
{"class":"org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy",
"connection":
{"autoCommit":true,"catalog":null,"class":"...