Spring Boot

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 short Spring Boot tutorial, I am going to share with you how to make Spring Boot app show Hibernate SQL Queries. Enable Hibernate SQL Queries Logging To show hibernate SQL queries in Spring Boot log file you will need to update the application.properties file with the following details: logging.level.org.hibernate.SQL=debug Show SQL Values Additionally,…

Read More Show Hibernate SQL Query in Spring Boot

In this blog post, I am going to list commonly used POM.XML dependencies for building RESTful Web services with Spring Boot and Spring MVC. The list of below dependencies is not complete and will depend on the functionality you need your RESTful Web Services to support. But if you are building a simple REST API…

Read More Common POM.XML Dependencies for RESTful Web Services

The list of below video tutorials is a Quick Start to learning How to Build RESTful Web Services with Spring Framework. Spring Framework is large and there is so much to learn about it. And although there are so many tutorials on the Internet I still felt it would be helpful to create a series…

Read More RESTful Web Services with Spring Framework. Video Tutorials

In this tutorial, I am going to share with you how to add H2 In-memory database support to your Spring Boot project which has Spring Security enabled. And at the end of this tutorial, you will find a video demonstration of how to do it. Once you do the below-described steps, your Spring Boot project…

Read More Add H2 Database to Spring Boot Project with Spring Security

In this short tutorial, I am going to share with you how to enable CrossOrigin in a RESTful Web Service API built with Spring Boot, Spring MVC and which also has Spring Security enabled. Enable CrossOrigin for Specific Endpoint  To enable cross origin AJAX HTTP request to a specific RESTful Web Service endpoint in our Rest Controller…

Read More CrossOrigin and CORS in RESTful Web Service

In this tutorial, we will create a Spring Boot application which demonstrates how we can add and use the H2 in-memory database in our application. You will learn how an in-memory database like H2 can be used to develop a Spring boot application without an overhead of doing DB configuration on your machine and without…

Read More Using H2 In-memory Database with Spring Boot

Almost in every RESTful Web Service application, I have to do the DTO to Entity and then Entity to DTO conversion. DTO stands for Data Transfer Object and is a simple Plain Old Java Object which contains class properties and getters and settings methods for accessing those properties. In this blog post, I am going…

Read More DTO to Entity and Entity to DTO Conversion

With this Spring Boot tutorial, I am going to share with how to handle exceptions in your RESTful Web Service application build with Spring Boot. What If Exception Takes Place The good news is that if Exception takes place and your code does not handle it, Spring Boot will handle the Exception for you and will…

Read More Handle Exceptions in Spring Boot RESTful Service

With this short blog post, I am going to share with you a few ways you can read application properties from application.properties file in Spring Boot. I am going to share 3 ways: Read application.properties using Environment object,  Read a property from application.properties file using @ConfigurationProperties and reading a property using the @Value annotation. To demonstrate how…

Read More Reading application.properties in Spring Boot

It is extremely simple to add logging support to your RESTful Web Service application with Spring Boot. To use Spring Boot logging you do not really need to add any additional dependencies or libraries to your web app project other than the org.springframework.boot example of which is below. But if you are working on a Spring Boot…

Read More Spring Boot Logging with LoggerFactory