Java

In this Spring MVC tutorial, you will learn how to use the @RequestParam annotation to read the URL Query request parameters in your Spring MVC Web Services application. Let’s assume we have the following URL to your Web Service endpoint. http://localhost:8080/api/users?page=1&limit=50 If we break the above URL down into smaller parts then we will see…

Read More @RequestParam Example in Spring MVC

In this Spring MVC tutorial, you will learn how to use a @PathVariable parameter to read the path parameter value. Let’s say we have the following URL: http://localhost:8080/api/users/5jg8hf4ys9fit If we break the above URL down into smaller parts then we will see that: HTTP – is the protocol being used, localhost  – is the domain name,…

Read More @PathVariable Example in Spring MVC

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

With this blog post, I am going to share with you Spring MVC annotations for mapping HTTP requests into specific handler methods. Then @PostMapping, @GetMapping, @PutMapping and the @DeleteMapping. In most of the Spring MVC applications, you will see the use of @RequestMapping annotation, which I am also going to include in this blog post. But I will…

Read More Spring MVC – @PostMapping, @GetMapping, @PutMapping, @DeleteMapping

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

In this blog post, I am going to share with you how to configure Spring Data JPA in a Jersey 2 Container Deployable Web App. Spring Data JPA makes it much easier and more convenient to persist and read data from the database and when I needed to tie together Spring Data JPA and Jersey 2 Web…

Read More Configure Spring Data JPA in Jersey 2 JAX-RS App