Working with Spring REST | RESTful Services with Spring

Next-Level Spring: Explore Best Practices for Writing RESTful Services in Java using Spring Boot



2 Days

Course Overview

Spring REST focuses on providing an understanding of the fundamental principles and technologies that are used in the development of RESTful services and clients.  This understanding is critical to being able to diagnose, troubleshoot, tune, and perform other lifecycle activities.

Working with Spring REST is a two-day, fast-paced coding course geared for experienced developers who have prior working knowledge of Java.  Throughout the course students learn the best practices for writing Restful services in Java using Spring Boot. The course provides an in-depth view of the APIs provided by Spring to develop both the REST service and the REST client.

Course Objectives

This “skills-centric” course is about 50% hands-on lab and 50% lecture, designed to train attendees in core Cucumber and web testing skills, coupling the most current, effective techniques with the soundest industry practices. Working within in an engaging, hands-on learning environment, guided by our expert team, attendees will:

  • Learn the request-response cycle of REST requests
  • Implement a REST controller using Spring
  • Map URLs to service endpoints
  • Use Spring's template class to develop a REST client
  • Bootstrap a Spring REST applications
  • Return different media types for a service
  • Setting the response headers
  • Discuss Exceptions and HTTP Status codes
  • Handle exceptions thrown by a service

Need different skills or topics?  If your team requires different topics or tools, additional skills or custom approach, this course may be further adjusted to accommodate.  We offer additional Spring, Java / JEE programming, Microservices / Services, REST, TDD / testing, design, application security and other related topics that may be blended with this course for a track that best suits your needs.

Course Prerequisites

This in an intermediate-level Java development course geared for students experienced with Java and Spring programming essentials.  This course does not cover Java or Spring development basics.

Please see the Related Courses tab for specific Pre-Requisite courses, Related Courses that offer similar skills or topics, and next-step Learning Path recommendations.

Course Agenda

Please note that this list of topics is based on our standard course offering, evolved from typical industry uses and trends. We’ll work with you to tune this course and level of coverage to target the skills you need most.

Session: Implementing REST with Spring

Lesson: REST principles

  • Introduce the six architectural constraints of REST
  • Introduce Resources and Resource representations
  • Best practices for defining Resource URIs
  • Tutorial: Setup Eclipse for Using Maven

Lesson: Introduction to RESTful Services in Spring

  • Discuss the request-response cycle of REST requests
  • Defining a REST Controller in Spring
  • Explain the @ResponseBody annotation
  • Define request mappings
  • Use path variables
  • Lab: Working with Spring REST

Lesson: Introduction to REST Clients in Spring

  • Introduce RestTemplate class
  • Making GET, POST, PUT, HEAD, OPTIONS and DELETE requests
  • Introduce the UriTemplate class
  • Using HttpEntity and RequestEntity
  • Use the exchange method to define ‘complex’ requests
  • Process requests and responses using callback
  • Configure the RestTemplate
  • Lab: Implementing the Spring REST Client

Lesson: Bootstrapping the REST application

  • Describe steps needed to bootstrap Spring REST application
  • Configure Content Representation libraries
  • Configure Spring MVC and map the Dispatcher Servlet
  • Explain the advantages of using Spring Boot to setup the REST project
  • Setup a Spring REST application using Spring Boot
  • Lab: Spring Hotel Reservation
  • Lab: Spring Hotel Reservation Client

Lesson: Content Representation

  • Returning different media types from service
  • Introduce negotiated resource representation
  • Configure Message Converters
  • Lab: Spring REST Content Negotiation

Lesson: Implementing the REST Service

  • Process for Spring REST Implementation
  • The Domain object
  • Using Project Lombok to define the domain object
  • (Not) Using Data Transfer Objects
  • ResponseEntity builder interfaces
  • Setting Location header using UriComponentsBuilder
  • Lab: Spring REST Services

Lesson: Error Handling

  • Handling Exceptions and HTTP Status codes
  • Using @ResponseStatus
  • Exception handler methods in controller
  • Using Controller advices to handle exception
  • The ResponseStatusException class
  • Lab: Spring REST Exceptions

Session: Security and RESTful Services

Lesson: Securing Untrusted Input

  • Input Data Attacks
  • Protecting a Web Service
  • Tenacious D
  • Responding to Error State

Lesson: Defending RESTful Services

  • How Attackers See REST
  • Factors that Increase Attack Surface
  • Data Tampering
  • Cross Site Scripting
  • Bridging and its potential Problems
  • Dangerous Developer Assumptions
  • Three Basic Tenets for Safe RESTfulness

Course Materials

Each student will receive a Student Guide with course notes, code samples, software tutorials, step-by-step written lab instructions, diagrams and related reference materials and links (as applicable). Students will also receive the project files (or code, if applicable) and solutions required for the hands-on work.

Hands-on Setup Made Simple! Our dedicated tech team will work with you to ensure your student machines and learning environment is setup, tested and ready to go well in advance of the course delivery date, ensuring a smooth start to class and seamless hands-on experience for your students. We offer several flexible student machine setup options including guided manual set up for simple installation directly on student machines, or cloud based / remote hosted lab solutions where students can log in to a complete separate lab environment minus any installations, or we can supply complete turn-key, pre-loaded equipment to bring ready-to-go student machines to your students or in-person facility.  Please inquire for details.

Raise the bar for advancing technology skills

Attend a Class!

Live scheduled classes are listed below or browse our full course catalog anytime

Special Offers

We regulary offer discounts for individuals, groups and corporate teams. Contact us

Custom Team Training

Check out custom training solutions planned around your unique needs and skills.

EveryCourse Extras

Exclusive materials, ongoing support and a free live course refresh with every class.

Attend a Course

Please see the current upcoming available open enrollment course dates posted below. Please feel free to Register Online below, or call 844-475-4559 toll free to connect with our Registrar for assistance. If you need additional date options, please contact us for scheduling.

Course Title Days Date Time Price
Working with Spring REST | RESTful Services with Spring 2 Days Mar 23 to Mar 24 10:00 AM to 06:00 PM EST $1,895.00 Enroll
Working with Spring REST | RESTful Services with Spring 2 Days May 18 to May 19 10:00 AM to 06:00 PM EST $1,895.00 Enroll
Working with Spring REST | RESTful Services with Spring 2 Days Jul 13 to Jul 14 10:00 AM to 06:00 PM EST $1,895.00 Enroll
Working with Spring REST | RESTful Services with Spring 2 Days Sep 21 to Sep 22 10:00 AM to 06:00 PM EST $1,895.00 Enroll
Working with Spring REST | RESTful Services with Spring 2 Days Nov 9 to Nov 10 10:00 AM to 06:00 PM EST $1,895.00 Enroll

New Year, New Savings! 20223FOR1!
Enroll before Feb 15 for any THREE public classes in 2022 for the price of ONE! 

Click for Details & Additional Offers

Learn. Explore. Advance!

Extend your training investment! Recorded sessions, free re-sits and after course support included with Every Course
Trivera MiniCamps
Gain the skills you need with less time in the classroom with our short course, live-online hands-on events
Trivera QuickSkills: Free Courses and Webinars
Training on us! Keep your skills current with free live events, courses & webinars
Trivera AfterCourse: Coaching and Support
Expert level after-training support to help organizations put new training skills into practice on the job

The voices of our customers speak volumes

Special Offers
Limited Offer for most courses.

SAVE 50%

Learn More