Book Image

Spring MVC Beginner's Guide

By : Amuthan Ganeshan
Book Image

Spring MVC Beginner's Guide

By: Amuthan Ganeshan

Overview of this book

Table of Contents (19 chapters)
Spring MVC Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introducing REST


As I already mentioned, in a REST-based application, everything, including static resources, data, and operations, are considered as resources and identified by a URI. For example, consider a piece of functionality that can help us add a new product to our store; we can represent this operation by a URI, something like http://localhost:8080/webstore/products/add, and we can pass the new product details in XML or JSON representation to that URL. So, in REST, URIs are used to connect clients and servers to exchange resources in the form of representations (HTML, XML, JSON, and so on). In order to exchange data, REST relies on basic HTTP protocol methods: GET, POST, PUT, and DELETE.

Spring provides extensive support to develop REST-based web services. In our previous chapters, we saw that whenever a web request was made, we returned a web page to serve that request; usually, such web pages will always contain some states (dynamic data). However, in REST-based applications, we...