Sommaire :
| Sommaire | ||
|---|---|---|
|
...
Introduction
Esup-commons V2 utilise la norme JAX-RS pour exposer la couche métier en REST. L'implémentation utilisée est celle offerte pour CXF.
...
| Bloc de code |
|---|
@Path("/domainService/")
@Produces("application/json")
public interface DomainService extends Serializable {
.../...
@GET
@Path("/users/{id}")
User getUser(@PathParam("id") String id) throws UserNotFoundException;
.../...
@GET
@Path("/users")
List<User> getUsers();
.../...
@DELETE
@Path("/users/{id}")
void deleteUser(@PathParam("id") User user);
.../...
@PUT
@Path("/users/{id}")
void addUser(@PathParam("id") User user);
.../... |
Pour avoir plus d'information sur les annotations JAX-RS Cf.JAX-RS : Understanding the Basics
...