Chapter 6. Creating REST services

 

This chapter covers

  • Defining REST endpoints in Spring MVC
  • Enabling hyperlinked REST resources
  • Automatic repository-based REST endpoints

“The web browser is dead. What now?”

Roughly a dozen years ago, I heard someone suggest that the web browser was nearing legacy status and that something else would take over. But how could this be? What could possibly dethrone the near-ubiquitous web browser? How would we consume the growing number of sites and online services if not with a web browser? Surely these were the ramblings of a madman!

Fast-forward to the present day and it’s clear that the web browser hasn’t gone away. But it no longer reigns as the primary means of accessing the internet. Mobile devices, tablets, smart watches, and voice-based devices are now commonplace. And even many browser-based applications are actually running JavaScript applications rather than letting the browser be a dumb terminal for server-rendered content.

With such a vast selection of client-side options, many applications have adopted a common design where the user interface is pushed closer to the client and the server exposes an API through which all kinds of clients can interact with the backend functionality.

6.1. Writing RESTful controllers

6.2. Enabling hypermedia

6.3. Enabling data-backed services

Summary

sitemap