I want to serialize my java data classes to JSON. To be honest, I posted a relevant question few days ago, however I haven't got my answer so far. At the moment, all answers suggest the Jackson's annotations. But I prefer not to get the classes involved directly and I think it's better that delegate this work to views.
Nevertheless, I found out that SpringMVC supports GroovyTemplate and I've a pleasant experience to deal with Groovy templating and builders and so I've a good sense about them. But I could find Groovy templates to build only html files. All of the examples begin with similar lines like this:
html {
head {
title( ... )
...
}
}
Is there any way to write Groovy template in context of SpringMVC that provide JSON? For example, something like Grails JSON views known as gson files(see this).
I appreciate all for paying attention.