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.
Inheritance or XML configuration
From the course: Java EE: RESTful Service with JAX-RS 2.0
Inheritance or XML configuration
- As we have seen in previous videos the resources represented by a URL are made up of the domain, context name space, followed by the base URI for the application path, and then the resource name. How do you define the base URI? There are two ways to make this configuration: By inheritance, and in the deployment descriptor. So by inheritance you create a class which subclasses the application class, which is then annotated application path. The name of the base URI is past the annotation. Alternatively, by specifying the URL pattern for the servlet mapping in the application's web.xml file. OK let's examine both of these methods in a little more detail. If you choose the inheritance configuration route, you would need a minimum of one application path defined within your application, although it is perfectly legal and quite common to have more. This is the manner in which we are going to configure the bookshop application. I will show you how to do this in just a moment. If you…
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)
-
-
-
-