خرید بک لینک

Vote count: 0

I have grails 3.1 application.

Below is the code for customizing the elements, which uses JSON marshaller, which works perfectly.

JSON.createNamedConfig("memeListView", {
            JSON.registerObjectMarshaller(Meme) { Meme memeIns ->
                retu [
                        caption: memeIns.caption,
                        likeCount: memeIns.likeCount,
                ]
            }
        })

But, I have tried the above code for XML marshaller, but it displays entire object attributes, instead of required. Below is the code for XML marshalling.

XML.createNamedConfig("memeListView", {
                XML.registerObjectMarshaller(Meme) { Meme memeIns ->
                    retu [
                            caption: memeIns.caption,
                            likeCount: memeIns.likeCount,
                    ]
                }
            })

Kindly suggest me, how to do marshalling for xml response.

asked 36 secs ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 22 فروردين 1395 ساعت: 10:51

صفحه بندی