Clone wiki

play-jersey / Home

What it is

play-jersey integrates Jersey into the Play! Framework. This enables you to use JAX-RS 1.1 annotations.



TODO: how to load the plugin


Add the plugin into your dependencies.yml:

    - play
    - jersey -> jersey

Also, you need to import the following rule:

GET     /	     module:jersey


There is one convention that you may override. Per default, all your ressources are found under "/rest". This can be changed by setting "jersey.path":

jersey.path = /api


Put some ressources and/or providers somewhere under your "app" folder. There is no structure forced, but here is a recommendation:


A Ressource may look like this:

public class HelloRessource {
    public Response helloJson() {
        return Response.ok("Hello").build();

    public Response helloXml() {
        return Response.ok("Hello").build();


play-jersey is using Jackson to serialize/deserialize your entities. It ships 2 default providers: DefaultJacksonProvider and DefaultJacksonXmlProvider. XML usses Jackson XML Databind, so there is no JAXB involved.


Thanks go to Stephane Epardaud who wrote the RESTEasy play plugin. Without his code it would have been much harder to come up with this one.


All my code of play-jersey is distributed under the Apache License 2.0

Two jersey specific files are taken from Jersey and adapted to my need - their header is intact and files are marked as beeing CDDL 1.1 with CPE.

Included libraries: Jackson is distributed under the Apache License 2.0 Jersey is distributed under both, the CDDL 1.1 and GPL 2 with classpath exception