From the course: Java EE: RESTful Service with JAX-RS 2.0
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Define the REST contract
From the course: Java EE: RESTful Service with JAX-RS 2.0
Define the REST contract
- [Instructor] Let's lay out the endpoint URIs that we will be implementing in the REST API. In the bookshop application, there are going to be two resources: a book resource and an author resource. For both of these resources, we will be defining the appropriate endpoint URIs. These URIs, combined with the appropriate HTTP method, URI variables, or parameters, form the API contract with the client. In order to be clear about the contract's terms, we should specify what they are. First of all, you need to define the application namespace. That's the route to the application. Then, the application path to the route of the API itself. So, for the REST server application, the namespace for the application is rest-server and the application path to the REST API itself is /api. So this, then, makes the route to the REST API rest-server/api. The REST server application will be deployed locally and on port 8081. It's deployed on port 8081 so that the REST application can be deployed on port…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Define the REST contract3m 42s
-
(Locked)
Inheritance or XML configuration3m 25s
-
(Locked)
Define the API root3m 14s
-
Create the resource entity5m 37s
-
(Locked)
Create the resource methods6m 16s
-
(Locked)
Path parameters2m 35s
-
(Locked)
Add path paramaters3m 21s
-
@Consumes and @Produces2m 7s
-
(Locked)
Add the media types4m 56s
-
(Locked)
Challenge: Add resource methods31s
-
(Locked)
Solution: Add resource methods1m 56s
-
(Locked)
-
-
-
-