Get GlassFish V2
Purchase Support Worldwide
Feb 08
28
Better JSON in Jersey, jMaki included
  Posted by pelegri in Web.Next

ALT DESCR

JSON (JSON@TA) is a key component in Ajax and a REST framework like Jersey needs to support it well to be successful. Jakub reports on a new simpler default JSON data format in the latest Jersey; check his Description of Features and then see its use in jMaki Widgets.

Check it out and let Jakub, Paul and Marc know how it works for you.

Jersey's latest release is 0.6ea and is available from the Jersey Downloads Page. The latest stable release is 0.5ea and is also available through the Update Center. Jersey 0.6ea will be pushed to the UC in about 10 days.

Oct 07
7
How to consume Jersey resource representations in jMaki ?
  Posted by arungupta in Web.Next

Informational Sign

A tip on jMaki and Jersey working together:

How to consume JSON and XML representations generated by Jersey in jMaki ?

Sep 07
15
Arun's TOTD Series - Tips on Metro, jMaki and more...
  Posted by pelegri in Web.Next

Headshot of Arun

Arun has started a TOTD (Tip of the Day) Series covering jRuby, jMaki, Metro, GlassFish and more. The entries are usually very detailed and focused on specific tasks.

You can get the whole stream as an RSS Feed. The last 5 entries are:

Using JDBC connection pool/JNDI name from GlassFish in Rails Application,
Generating JSON using JAXB and Jersey
Switch between jRuby and cRuby in NetBeans
Difference betwen Ruby Gems and Plugins
Loading Data from Beans in jMaki Widgets

We will try to give you heads-up of new additions via quick Tips.

Sep 07
4
JSR 311 vs. Jersey vs. SWDP vs. GlassFish vs. NetBeans
  Posted by alexismp in Web.Next

Island of Jersey

If you're new to JAX-RS (JSR 311) and RESTful Web Service with Java, wondering how it impacts you as a developer, you should read this introduction to the various Sun efforts in that space.

If you're tracking the progress of Jersey, the JAX-RS Reference Implementation, you'll probably interested to hear that version 0.2.1 has been released today with a documented list of required JAR dependencies, illustrated in this demo showing how JAXB beans can be serialized as JSON or XML depending on the Accept HTTP header).

At this point, installing in GlassFish is fairly easy with a jersey-on-glassfish.xml ANT script. It'll get even easier once Jersey is made available on the GlassFish Update Center. Any day now I hear ;)

Aug 07
7
JSON Encoding - Now in Jersey too
  Posted by arungupta in GlassFish

Encoder

Paul added support for pluggable type system in Jersey. All the supported types need to implement the EntityProvider interface and are registered in the META-INF/services file javax.ws.rs.ext.EntityProvider. Jakub used that system to add support for JSON encoding. Jersey is the GlassFish project that is implementing JAX-RS

The JSON binding in JAX-RS enables to use application/json as the MIME type and specify JSONArray, JSONObject as method parameters and return type. The JSON binding in JAX-RS enables to write code like the following:

@UriTemplate("/rates")
public class ExchangeRates {
    @ProduceMime("application/json")
    @UriTemplate("CZK")
    public JSONObject getRates() {
        try {
            return new JSONObject()
            .put("USD", 20.04);
        } catch (JSONException ex) {
            throw new WebApplicationException(ex);
        }
    }
}

JAX-WS takes advantage of a similar pluggable encoding layer in their implementation to provide a JSON binding.

Apr 07
28
Improved JSON Support
  Posted by pelegri in GlassFish

More improvements to the JSON support in GlassFish. Kohsuke reports on progress in the client-side programming model, including a new, JavaScript-centric tool in the spirit of wsimport).

The JavaScript client can then just include the proxy script and then asynchronously invoke the WS service as follows:

<script src="path/to/endpoint?js"></script> myService.get( {id:5}, function(r) { alert("ID="+r.id); alert("title="+r.title); } );

Screenshot of generated documentation

The JSON extension exploits the Schema analysis machinery in JAX-WS which means that it can generate nice JavaScript and can also do things like generating very nice looking documentation automatically - as shown (somewhat washed out) at left.

JSON support is in the "and more..." portion of Kohsuke and Jitu's presentation at JavaOne: TS-4948 "Unleashing the Power of JAX-WS RI: Spring, Stateful Web Services, SMTP, and More... :-). At least Kohsuke, and probably also Jitu, will also be present at GlassFish Day - register for free here.

Apr 07
13
Support for JSON in JAX-WS at GlassFish
  Posted by pelegri in GlassFish

Jason bringing Pelias the Golden Fleece

The JAX-WS project in GlassFish is taking advantage of the pluggable encoding layer in their implementation to provide a JSON binding.

This Implementation is at an early stage and is part of the JAX-WS-commons extensions which also includes such committed extensions as: Spring Support, HTTP Session Scope Service, Thread Scope Service and the JAX-WS Maven 2 plugin.

The JSON binding enables to write code like the following:

@BindingType(JSONBindingID.JSON_BINDING) public class MyService { public Book get() { return new Book(); } public static final class Book { public int id = 1; public String title = "Java"; } }

Mar 07
9
Combining Roller, JSON and jMaki
  Posted by pelegri in GlassFish

jMashing up!

It all started with Dave "Roller" Johnson writing about Roller generating JSON. Alexis picked it up in his jMakifying Roller entry and short video. Some limitations found in this quick hack were addressed in this follow-up entry and in the jMaki day presentations. Neat!!

In another example combining JSON and jMaki Jennifer show how to load a table from JSON. Don't miss the comments for the entry, they are also useful.

In many case XML is still a no-brainer, but the increased adoption of JavaScript on the client makes JSON an interesting lingua franca for web apps. And, in cases where JavaScript is also used on the server-side (e.g. Phobos) JSON seems the most natural format for structured data exchange.

Oct 06
20
JSON for Ajax Web services
  Posted by qouyang in Web.Next

Via TheGalaxy, Daniel Rubio's recent article talks about the advantages of JavaScript Object Notation (JSON), and how JSON as an approach has recently gained popularity with Ajax services and Web-based clients. In this entry on TheServerSide, a discussion is open on Daniel's article. "What benefits have you been experiencing while using JSON? Do you agree that its recent boost in popularity has been due to Ajax?"


Languages

NEWS AND EVENTS

Join us at CommunityOne
ALT DESCR

Free!

Search

Popular Tags

adoption ajax clustering community fastinfoset frontpage glassfish grizzly hudson interoperability java javaee javaone jax-rs jax-ws jaxb jboss jcp jersey jmaki jruby jsf maven metro mysql netbeans opends opensource opensso performance phobos php portal rails rest roller ruby sailfin scripting sip sun tools updatecenter v2 v3 webserver webservices weekly wsit xml

Companion Blogs

Useful Blog Entries

Friends and Relatives

Subscribe

Enter your Email

Contact Us

Send feedback and leads to theaquarium@sun.com

Downloads

Events


Adoption Stories

Related Links

Recent Entries

Latest Project News

Navigation