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.
Example of REST implementation :
@Path( SERVICE_PATH ) public class MyRest { @GET @Path( Constants.SEARCH_PATH ) @Component @Produces( MediaType.APPLICATION_JSON ) public Response getItemsList( ) { // search... return Response.status( Response.Status.NOT_FOUND ) .entity( JsonUtil.buildJsonResponse( new ErrorJsonResponse( Response.Status.NOT_FOUND.name( ), Constants.ERROR_NOT_FOUND_VERSION ) ) ) .build( ); } }
The Rest classes should be declared in plugin context :
<bean id="my-app.restService" class="fr.paris.lutece.plugins.myapp.modules.rest.service.myappRest">