by BehindJava

Beginner tutorial on building and running RESTful Web Services with HTTP CRUD operations using Spring Boot

Home » springboot » Beginner tutorial on building and running RESTful Web Services with HTTP CRUD operations using Spring Boot

In this tutorial we are going to learn about RESTful Web Services and implementing them with the best practices and perform basic crud operations on user details like create, read, update and delete.

These are the important topics that must be covered while preparing for a Java interview on Spring Boot and Restful web services.

What is SpringBoot?

Spring Boot is built on top of the Spring Framework which is easier and faster way to set up, configure, and run web-based applications. Spring Boot is the combination of Spring Framework and Embedded Servers like Tomcat and Jetty.

Pros:

  • Simplified & version conflict free dependency management through the starter POMs.
  • We can quickly setup and run standalone, web applications and micro services at very less time.
  • You can just assemble the jar artifact which comes with an embedded Tomcat, Jetty or Undertow application server and you are ready to go.
  • Spring Boot provides HTTP endpoints to access application internals like detailed metrics, application inner working, health status, etc. -No XML based configurations at all. Very much simplified properties. The beans are initialized, configured and wired automatically.
  • The Spring Initializer provides a project generator to make you productive with the certain technology stack from the beginning. You can create a skeleton project with web, data access (relational and NoSQL datastores), cloud, or messaging support.

Cons:

  • Spring boot may unnecessarily increase the deployment binary size with unused dependencies.

Components of Spring Boot

The whole application logic revolves around its components. There are three main components of Spring Boot :

  1. Controller: It is responsible to handle user request and return appropriate response.
  2. Service: Here we implement the business logic of the application.
  3. Repository: Here we write the logics to perform datbase transaction on data ( save, updadate and retrieve).

Table of Contents