users@glassfish.java.net

Re: JSON Web Services

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 07 Nov 2008 09:14:13 +0100

Hi,

See the following Jersey sample:

http://download.java.net/maven/2/com/sun/jersey/samples/json-from-jaxb/1.0/json-from-jaxb-1.0-project.zip

and the following tech tip:

http://blogs.sun.com/enterprisetechtips/entry/configuring_json_for_restful_web


JSON and REST are not the same.

JSON is a data format that is a subset of the JavaScript language and
as a result the format is very easy to produce and consume by
JavaScript programs e.g. those running in Web browsers. But it can
also be for JavaScript servers like Phobos.

REST is an architectural style that declares constraints. If those
constraints are applied to your architecture then it induces certain
desirable properties, like loose coupling or scalability, which are
important when building applications for the Web.

The relationship between JSON and RESTful Web applications is as
follows: Resources, identified by URLs, produce and consume
representations when a client makes a request using an HTTP method.
The representations are identified by a media type, which describes
what the representation is. Such a representation may be a JSON
document and might be identified by the media type "application/json".
JSON is just one of many data formats you may choose to use in your
Web application.

Hope that helps,
Paul.

On Nov 7, 2008, at 3:21 AM, glassfish_at_javadesktop.org wrote:

> Thanks a lot.
>
> Is the rest and json are same?
> [Message sent by forum member 'farazali' (farazali)]
>
> http://forums.java.net/jive/thread.jspa?messageID=315377
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>