Author: Sergey Kargopolov

In this tutorial, you will learn how to create a Web Service or a Microservice and how to make it register with Eureka Discovery Server. For a step by step series of video lessons, please check this page: Spring Boot Microservices and Spring Cloud. Start Eureka Discovery Server To be able to follow this tutorial…

Read More Register Web Service with Eureka Server

Spring Boot has a nice feature which enables the application to automatically restart when you make a change to your Java code. This automatic restart of your application is often called Hot Swap. Spring Boot Dev Tools Dependency To enable your Spring Boot application to automatically restart when you make a change to your Java…

Read More Spring Boot Hot Swap or Automatic Restart

Software engineers, programmers, and IT persons work together under the canopy of information technology, although their roles and responsibilities are quite distinct. These three professions are quite essential in the development of software applications, so it is really not possible to put one over the rest of them. It is however necessary for us to…

Read More Software Engineer VS Programmer VS IT Person

In this tutorial on Spring Framework you will learn how to use constructor-based dependency injection(DI) in Spring Framework when building RESTful Web Services. Injecting an Object Let’s assume we need to inject a Utility class into a Service class we have. Below is an example of a UserService class which uses Constructor-Based dependency injection to…

Read More Constructor-Based Dependency Injection in Spring

In this tutorial, you will learn how to use the @Autowired and @Qualifier annotations together to auto wire a specific Bean. Sometimes you might have more than one Bean of the same type and if you do not explicitly specify which one you would like to auto wire, you will get an NoUniqueBeanDefinitionException when starting up…

Read More How to Use @Autowired and @Qualifier in Spring

In this short Spring Boot tutorial, you will learn how to pass command-line arguments to your Spring Boot application. Passing Command-Line Arguments To pass command line arguments to your Spring Boot app when running it with Maven use the -Dspring-boot.run.arguments. In the below code example, I will pass two command-line arguments: firstName and lastName. mvn spring-boot:run…

Read More Pass Command-Line Arguments to Spring Boot Application

In this Spring MVC tutorial, you will learn how to read HTTP Request Header in the Rest Controller class of your Application. To read HTTP Request Header in Spring MVC application we use @RequestHeader annotation. @RequestHeader(value=”Accept”) String acceptHeader Reading HTTP Request Header For example, let’s assume we need to create a method in our Rest…

Read More Read HTTP Request Header in Spring MVC

In this Swagger tutorial, I am going to share with you how to add Contact and API information to your RESTful Web Service documentation created with Swagger. When adding Swagger to our RESTful Web Service, we usually create a new configuration Java Class which is then annotated with @Configuration annotation. Below is an example of…

Read More REST API Contact and ApiInfo with Swagger

In this tutorial, you will learn how to add Swagger or an OpenAPI support to your Spring Boot project so that you can start documenting your REST API. To be able to follow this tutorial you will need to have your REST API Spring Boot project created. If you do not have one, here is…

Read More How to Add Swagger to a Spring Boot REST API Project

In this tutorial, you will learn how to deal with an infinite recursion problem or circular reference which takes place when you try to return an Object with Bidirectional Relationships in the body of HTTP Response. Infinite Recursion Problem Let’s have a look at an example which will cause an Infinite Recursion problem in our RESTful Web…

Read More Infinite Recursion in Objects with Bidirectional Relationships