API – Jersey

Jersey – RESTful Web Services in Java, even as a Python developer, I constantly came across Jersey web application while working with those Apache projects. One can easily see how widely Jersey has been using in the Java world.

Here is the get started page of jersey that I followed along. MVN really made my life easier so I don’t have to spend too much time setting up the environment, dealing with dependencies..etc.

jersey_simple_service_code

The first image has the Java code for building an API end point that any http get request will return “GOT IT”. The code was quite easy and Junit test also indicates the fact that test driven development is should be considered regardless of how small your task is.

jersey_simple_service

Here is the how the final “simple service” runs like, there is also a wadl (web application description language) which is an XML file that demonstrate the application is running properly and all the related meta data.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s