RESTful Services, Part 2 of 5: Injection and Sub Resources

RESTful Services, Part 2 of 5: Injection and Sub Resources

LearnNow Online
Updated Aug 21, 2018

Course description

Just like any modern framework running on a Java application server, JAX-RS defines a lifecycle for the resources that you create. In this course, you will learn about the JAX-RS lifecycles of Instance per request, as well as how singletons behave. Along with those topics we will also explore all of the elements that can be injected into a service to provide access to all the different parts of the HTTP request and response. Lastly, we will look at the power of sub resources.

Each LearnNowOnline training course is made up of Modules (typically an hour in length). Within each module there are Topics (typically 15-30 minutes each) and Subtopics (typically 2-5 minutes each). There is a Post Exam for each Module that must be passed with a score of 70% or higher to successfully and fully complete the course.


This course assumes that the users have experience coding with Java. You should have already viewed the “RESTful Services: Overview and JAX-RS” course before viewing this course.

Meet the expert

John Kidd

John Kidd is a nationally recognized instructor and consultant who travels the country sharing his expertise in java enterprise, SCRUM, and big data and related technologies. John has over 20 years of teaching and project development experience including roles from developer to vice president of research and development. John is also a popular speaker at several conferences in both the U.S. and Europe.

Video Runtime

80 Minutes

Time to complete

220 Minutes

Course Outline

Injection and Sub Resources

Life Cycle (21:40)

  • Introduction (00:22)
  • Demo: Review & New Resource (05:13)
  • Demo: Singletons (05:07)
  • Demo: Singletons vs Inst./Req. (05:15)
  • Demo: Only two options (05:32)
  • Summary (00:09)

Injection (22:12)

  • Introduction (00:24)
  • Demo: Context (05:20)
  • Demo: Uri Info (04:59)
  • Demo: Return to Singleton (05:28)
  • Demo: More Context (cont.) (05:46)
  • Summary (00:12)

Sub Resources (20:15)

  • Introduction (00:17)
  • Demo: Add Resource & Classes (05:15)
  • Demo: Sub Resources (cont.) (04:50)
  • Demo: The Resource (04:44)
  • Demo: How It Works (cont.) (04:53)
  • Summary (00:13)

Sub Resources Continued (16:45)

  • Introduction (00:15)
  • Demo: Run the Code (05:40)
  • Demo: Delegation (05:20)
  • Demo: Reality (05:21)
  • Summary (00:08)