Showing results for REST (category)

Control JAX-RS Content Negotiation with Filters

Comments Off January 18th, 2010 by Henri Bezemer

JAX-RS supports very sophisticated content negotiation, built around the HTTP accept header and the @consumes and @produces annotations. Unfortunately some (potential) RESTful clients are not so sophisticated. Try your webbrowser for instance. It is not always easy or even possible to set the HTTP accept header to the desired value. In this post I’ll present a simple Filter (javax.servlet.Filter) that dynamically adds HTTP accept headers to your requests, based on a predefined URI pattern. It has been tested with the Jersey implementation of JAX-RS. Read more…

Put JAX-RS to work with Adobe Flex

1 Comment » January 13th, 2010 by Henri Bezemer

In my previous post I’ve shown how to build a simple set of RESTful services with JAX-RS, and how to access those services from a XForms client. That example also showed the RESTful principle of HATEOAS. In this post I’ll show how to build a Adobe Flex 3 client to those services. Read more…

HATEOAS by Example

3 Comments » January 7th, 2010 by Henri Bezemer

Hypermedia as the Engine of Application State (HATEOAS) is a very useful concept in the RESTful architectural style. The best way to show the benefits of HATEOAS is by giving an example. In this post I’ll be using the Jersey JAX-RS framework to build three RESTFul services. By mixing XForms into the equation, these services form a complete (yet tiny) web application. The example can be deployed on GlassFish. Read more…

XForms backed with JAX-RS RESTful services

Comments Off December 31st, 2009 by Henri Bezemer

In an earlier post I presented a simple example of a login form implemented with XForms. In this example, XML data submitted by the form is parsed by a Java Servlet into a DOM tree, data is extracted using XPath and finally the servlet directly prints a XML result to its response stream. For large scale development, this is not the most efficient and safe way to implement this functionality.

JAX-RS allows us to efficiently build RESTful services, which are a perfect match to XForms. In this post I’ll present a JAX-RS service to replace the servlet from the login form example. Read more…

JAX-RS: At ease with REST

Comments Off December 29th, 2009 by Henri Bezemer

In this post I will create a RESTful service using the JSR 311 JAX-RS implementation called Jersey on the GlassFish application server. This service will closely match the capabilities of the typical hello world demo. The focus of this post is to show how to develop a RESTful service with JAX-RS and Maven and how to deploy it on a J2EE application server like GlassFish. Read more…