users@jersey.java.net

Re: JSON with JAXB format

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Thu, 31 Jan 2008 11:17:16 +0100

Hi Fred,

for the current version it is not possible
to configure how JSON is generated out of JAXB beans.
However, i am now working on improving this
and i believe will have working prototype ready
by end of this week. What you describe
will be definitely supported.

If you can't wait for it or if you want to stay
with the current snapshot, i recommend you use
JSONObject/JSONArray low-level approach
to get a full control over how your JSON is formatted.
You can look at the Bookmark
example for further details.

~Jakub



On Thu, Jan 31, 2008 at 01:31:01AM -0800, Fred Cheng wrote:
> I am currently using jersey and returning objects in
> JSON using JAXB annotation. However, the formatting
> is a little strange because of its mapping convention.
> Is there a way to configure it to use Badgerfish
> notation to get rid of the extraneous "$" elements?
>
> Specifically, I would like to see
> {
> "variablename" : "value"
> }
>
> instead of
>
> {
> "variablename" : {"$" : "value"}
> }
>
>
> Thanks,
> fred
>
>
> ____________________________________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

-- 
Jakub Podlesak
http://blogs.sun.com/japod