Coder Social home page Coder Social logo

lutece-tech-plugin-rest's Introduction

Alerte Line of code Coverage

Plugin REST

Introduction

This plugin allows you to develop JAXRS REST services.

Configuration

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

Usage

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">
                

Maven documentation and reports

generated by xdoc2md - do not edit directly.

lutece-tech-plugin-rest's People

Contributors

alexandreclose avatar francoisericmerlin avatar glepine1 avatar isabelle-lenain avatar jgoulley avatar jonenst avatar l-lin avatar lobtx avatar pierrelevy avatar rdeniel avatar seboo avatar v-v- avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.