From the course: Java EE 8 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
URI template parameters - Java EE Tutorial
From the course: Java EE 8 Essential Training
URI template parameters
- [Narrator] In this lesson, we're going to take a look at how to use URI template parameters within JAX-RS. We're going to add them to a resource method and also see how to call them with the client. So, the first thing we're going to do is navigate to our find by catalog ID resource method and you'll notice right now we are using a Query Param. We're going to switch that up and use a URI template parameter. Now, to do that we modify the path to include a parameter in curly braces and we're going to name this parameter Catalog Item ID. At this point, we can go ahead and switch out our query parameter with a path parameter and this is very typical within REST APIs that you may build or use, so just kind of switch in the semantics. And then we can navigate to the remote inventory service, because we'll need to adjust the code that is causing our client to call the REST API. So, now instead of using the query pram method,…
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)
Rest overview1m 58s
-
(Locked)
JAX-RS overview5m
-
(Locked)
JAX-RS project setup3m 11s
-
(Locked)
Creating a resource5m 16s
-
(Locked)
JAX-RS client posts7m 22s
-
(Locked)
JAX-RS client gets4m 23s
-
(Locked)
URI template parameters2m 49s
-
(Locked)
Asynchronous features7m 51s
-
(Locked)
Reactive features5m 31s
-
(Locked)
Server-Sent Events6m 16s
-
(Locked)
-
-
-
-
-
-