Is it Fine written. Positive certainly comes short, but read on one breathing. Tnx
For the uninitiated, JSON “is a lightweight data-interchange format,” as humbly posted on JSON.org. It’s useful for architects in search of a lighter-than-XML transport or JavaScript developers who want service providers sending them easy to use objects for use in their pages. Grails has out-of-the-box JSON support via the JSONObject library, as well as through their converters “plugin” (which is now included in the core distribution). Converting grails domain objects to JSON (or XML, for the enthusiast) is as complicated as
render myDomainObject as JSON
render myDomainObject as XML
def json = {
if(!params.max) params.max = 10
render MyDomainObject.list( params ) as JSON
}
grails install-templates
def json = {
if(!params.max) params.max = 10
render ${className}.list( params ) as JSON
}
import grails.converters.JSON;
@see http://www.grails.org/Artifact+and+Scaffolding+Templates
@see http://www.json.org/
Is it Fine written. Positive certainly comes short, but read on one breathing. Tnx
It has a lot to do with the templates, nice post. Free Gift Box Template
Add your own comment below.
Next entry: Tech Note: Grails Custom One-To-Many Scaffolding
Previous entry: Great article on Groovy DSLs