TODO


This guide will help you create a TODO***.

You will learn

  • What?
  • Why?
  • How?
  • Where?
  • When?

Programming Courses

Resources/URLs/Entities Overview

In this guide, we will create three services using proper URIs and HTTP methods:

Project Code Structure

Following screenshot shows the structure of the project we will create. Image

A few details:

  • SpringBootTutorialBasicsApplication.java - The Spring Boot Application class generated with Spring Initializer. This class acts as the launching point for application.
  • pom.xml - Contains all the dependencies needed to build this project. We will use Spring Boot Starter AOP.

Tools you will need

  • Maven 3.0+ is your build tool
  • Your favorite IDE. We use Eclipse.
  • JDK 1.8+

Complete Maven Project With Code Examples

Our Github repository has all the code examples - https://github.com/in28minutes/spring-boot-examples/tree/master/TODO_URL

Article Begins

Some theory

Bootstrapping with Spring Initializr

Creating a REST service with Spring Initializr is a cake walk. We will use Spring Web MVC as our web framework.

Spring Initializr http://start.spring.io/ is great tool to bootstrap your Spring Boot projects.

Image

Image

As shown in the image above, following steps have to be done

  • Launch Spring Initializr and choose the following
    • Choose TODO as Group
    • Choose TODO as Artifact
    • Choose following dependencies
      • Web
      • DevTools
      • TODO
  • Click Generate Project.
  • Import the project into Eclipse. File -> Import -> Existing Maven Project.
  • If you want to understand all the files that are part of this project, you can go here TODO.

STEP 1 : TODO

Step N : Executing the TODO Service

Below picture shows how we can execute this Get Service from Postman - my favorite tool to run rest services. Image

Executing a POST Rest Service

Example Request is shown below.

Below picture shows how we can execute this Post Service from Postman - my favorite tool to run rest services. Make sure you go to the Body tab and select raw. Select JSON from the dropdown. Copy above request into body.

Image

Congratulations! You are reading an article from a series of 50+ articles on Spring Boot and Microservices. We also have 20+ projects on our Github repository. For the complete series of 50+ articles and code examples, click here.

Next Steps

Complete Code Example

  • TODO

Related Posts

Overloading Java Constructors - Be careful about it

Explains what choices are available to maximize reuse of constructor code

Java Printf - How to format console output

Format your Java Console output with printf

Introduction to Java Platform - JDK vs JRE vs JVM

Explains how The terms JDK, JRE and the JVM are related, but different

Introduction to Lambda Expressions in Java

Introduction to lambda Expressions. The main building block of functional programming.

Executor framework in Java - Take control over your tasks

Understand how to use Executor from in Java with Code Examples

Operator Precedence - Understand How Java Evaluates Expressions

Explains Java Operator Precedence Rules. Helps you easily understand expression evaluation.

Java Exception Handling with Finally

Understand how adding a finally clause to a try catch block neatly releases resources if there is an exception