Quantcast

using the JSON converters provided by the joda-time plugin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

using the JSON converters provided by the joda-time plugin

John Cartwright - NOAA Federal
Hello All,

I'm using version 1.4 of the joda-time plugin with grails 2.0.4 and
having a little trouble rendering a LocalDate field as JSON.

Given a domain class like:

class Person {
        String name
        LocalDate birthdate
        static mapping = {
                birthdate type: PersistentLocalDate
        }
}


and a controller like:


import grails.converters.JSON
import grails.plugin.jodatime.converters.JodaConverters

class PersonController {

        def test() {
                ...
                render person.birthdate as JSON
        }
}

I'm getting an exception like:

Value out of sequence: expected mode to be OBJECT or ARRAY when
writing '"2012-06-17"' but was INIT. Stacktrace follows:
Message: Value out of sequence: expected mode to be OBJECT or ARRAY
when writing '"2012-06-17"' but was INIT


Can someone please give me a little clarification on how to use the
rendering for Joda types?

Thanks!

--john

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: using the JSON converters provided by the joda-time plugin

makapacs
Hi,

I have the same question.

thanks

Loading...