Spring

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 that also has Spring Security enabled. Enable CrossOrigin for Specific Endpoint  To enable cross-origin AJAX HTTP requests to a specific RESTful Web Service endpoint in our Rest Controller class we can use…

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

In this tutorial, we will build a Spring Boot application which demonstrates how to access data in a MongoDB database using the MongoTemplate APIs.   For MongoDB, we will use mLab, which provides MongoDB Database as a Service platform so that you don’t even have to install a MongoDB database on your computer.  Also, at…

Read More Spring Boot and MongoTemplate Tutorial with MongoDB

In this tutorial, you will learn how to implement pagination in your RESTful Web Services app built with Spring Boot. The code example below will demonstrate how to implement pagination to implement “Get a list of users” registered with our app feature. I assume you already have your Spring Boot RESTful Web Service built but…

Read More Pagination Tutorial with Spring Boot REST

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

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 spring-boot-starter-web dependency of which is below. If you are working on a Spring Boot Web…

Read More Spring Boot Logging with LoggerFactory

In this blog post, I am going to share with you how to create a very simple RESTful Spring Boot Web Service with Spring Boot which uses Spring Data JPA to save to a database. This Web Service will accept HTTP Post request with user details and then save this user details into MySQL Database using…

Read More Spring Boot REST and JPA – Save to a Database

With this blog post, I am going to share with you how to quickly create a very simple Spring MVC Web Service project and then build and run it with Maven. In my following blog posts, I am going to enhance this Web Service project and add more functionality to it. And to begin with,…

Read More Create a Simple Web Service Project with Spring Boot