O'Reilly logo

Java EE 7 Developer Handbook by Peter A. Pilgrim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JAX-RS server-side endpoints

We have looked at a simple GET request on a JAX-RS simple resource. In order to create a useful business application, we need the other web request methods, namely POST, PUT, and DELETE.

JAX-RS common server annotation

JAX-RS defines annotations for defining server side REST style endpoint, which are found in the Java package javax.ws.rs.

The following is a table of these annotations:

Annotation

Description

@Path

Defines the relative URI path for the REST style Java class and configures where it is installed and mapped.

@GET

Defines a method on the Java class REST style resource to accept HTTP GET requests.

@POST

Defines a method on the Java class REST style resource to accept HTTP POST requests.

@PUT ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required