Jettison includes JSONObject and JSONArray impl but uses modified package names.
After adding [jettison.jar] (to support generating JSON from JAXB) into Jersey
we removed the original jar (containing org.json pkgs) to avoid redundancy in libraries.
~Jakub
On Thu, Aug 30, 2007 at 09:07:43AM -0700, Arun Gupta wrote:
> I'm familiar with this javadoc. But the package names were
> org.codehaus.jettison.json.JSONObject and that's what confused me.
>
> What is the link between org.json.JSON* and
> org.codehaus.jettison.json.JSON* ?
>
> -Arun
>
> Paul Sandoz wrote:
> >Hi Arun,
> >
> >See here:
> >
> >http://www.json.org/javadoc/org/json/JSONObject.html
> >http://www.json.org/javadoc/org/json/JSONArray.html
> >
> >Arun Gupta wrote:
> >>Where can I find an online version of Jettison JSON javadocs ?
> >>
> >>The following method in a resource:
> >>
> >> public JSONObject getJSONMessage() {
> >> try {
> >> return new JSONObject().put("greeting1", "Hello World");
> >> } catch (JSONException ex) {
> >> ex.printStackTrace();
> >> }
> >>
> >> return null;
> >> }
> >>
> >
> >Hint, you can do the following:
> >
> > public JSONObject getJSONMessage() throws JSONException {
> > return new JSONObject().put("greeting1", "Hello World");
> > }
> >
> >Paul.
> >
> >
> >>returns the result as:
> >>
> >>{"greeting1" : "Hello World" }
> >>
> >>I need to generate:
> >>
> >>{greeting1 : "Hello World" }
> >>
> >>I looked at the source code at:
> >>
> >>http://fisheye.codehaus.org/browse/~raw,r=26/jettison/trunk/src/main/java/org/codehaus/jettison/json/JSONObject.java
> >>
> >>
> >>and could not find anything obvious.
> >>
> >>-Arun
> >>
> >
>
> --
> Web Technologies and Standards
> Sun Microsystems, Inc.
> Blog: http://blogs.sun.com/arungupta
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>