Fork me on GitHub

Plugin REST


This plugin allows you to develop JAXRS REST services.


This plugin uses Jersey 2.

Singleton Root resources need the @component ( org.springframework.stereotype.Component ) annotation in addition to @path

Warning : This version 3.0.0 is not fully backwards compatible with oldest implementations.

  • Jersey will not use the spring bean without @component annotation and will instantiate the bean itself (the scope can be controller through annotations: prototype, request, singleton).
  • Spring Root resources with scope session or request are no longer supported


Example of REST implementation :

public class MyRest {

    @Path( Constants.SEARCH_PATH )
    @Produces( MediaType.APPLICATION_JSON )
    public Response getItemsList(  )
    	// search...
	return Response.status( Response.Status.NOT_FOUND )
                .entity( JsonUtil.buildJsonResponse( new ErrorJsonResponse( ), Constants.ERROR_NOT_FOUND_VERSION ) ) )
                .build( );

The Rest classes should be declared in plugin context :

<bean id="my-app.restService"