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

Inheritance or XML configuration

From the course: Java EE: RESTful Service with JAX-RS 2.0

Start my 1-month free trial

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…

Contents