In this tutorial, you will learn how to implement pagination in your RESTful Web Services application built with Spring Boot. The code example below will demonstrate how to implement pagination for the API endpoint that returns a list of users. I assume you already have your Spring Boot RESTful Web Service built, but if you…
Read More Pagination Tutorial with Spring Boot REST
When building RESTful web services with Spring Boot, we have two options for deployment. We can package our Spring Boot app as an executable JAR file and run it with the built-in Tomcat, or we can create a deployable WAR file and then deploy it into a standalone Tomcat or Jetty. In this blog post,…
Read More Spring Boot: Deployable WAR File
In this tutorial, you will learn how to create a simple Web Service Project with Spring Boot Intializr and then build and run it. After creating the web service project, we will add additional functionality. So, let’s get started. Multiple Ways to Create a Spring Boot Web Service Project There are three different ways to…
Read More Create a Web Service Project with Spring Boot Initializr
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
With this blog post, I am going to share what I needed to do to make JPA work in my Jersey 2 Web Services App. I have created my Jersey 2 app using the following maven snippet: mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes \ -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.26 I then opened pom.xml and added a few new dependencies which I…
Read More Configuring JPA in Jersey 2 Web App
Create a Servlet Container deployable Jersey web application Create new Jersey web application using Maven. The project created with the below jersey-quickstart-webapp archetype can be built and deployed to a servlet container like for example Apache Tomcat. mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes \ -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.26 POM.XML Dependency to Support JSON To support JSON in your Jersey Web App add…
Read More RESTful Web Services with Jersey and Spring Data JPA – Cheat Sheet
In this Java programming tutorial I would like to share with you a sample Java code that uses Amazon AWS SES(Simple Email Service) Java SDK to send an email message. I used this code implement Email Verification feature for my mobile app. The code below would send an email message containing an email verification link…
Read More Send Email Message Using AWS SES Java SDK
With this tutorial I wanted to share with you how to configure your Java project and it’s hibernate configuration file hibernate.cfg.xml to use a more professional and production ready connection pool provider C3P0. Hibernate’s internal connection pooling algorithm is rudimentary, and is provided for development and testing purposes. In my earlier blog posts I used…
Read More Configure Hibernate to Use C3P0 Connection Pool
In this blog post I am going to share with you a way to create a RESTful Web Service to: Create a new user profile, Generate and save in database a user secure user password rather than an actual password provided by user, Return back as a response a custom user profile object(JSON) with information that…
Read More RESTful Web Service to Save a New User in Database
Earlier I’ve published a blog post on now to create a RESTful Web Service(JAX-RS) to accept JSON payload with user profile details and how to save user profile details into a MySQL database using Java Hibernate framework. In this blog post I am going to share with you how to test(using JUnit and Mockito) it’s Service…
Read More Test RESTful Web Service with JUnit and Mockito
Create RESTFul Web Services with JAX-RS and Jersey Most of the below code examples have been included in my video course: REST API with Java JAX-RS. Create and Deploy to Amazon Cloud. So you can learn how to build RESTful Web Service either by following the below tutorials or watch video lessons or even both! :). Create…
Read More RESTful Web Services
In this short blog post I am going to share with you how to create a new Amazon AWS S3 bucket in Java and how to set permissions on it so that any user can read files from it but only you, the owner will have write access. You can use the code below with…
Read More Create Amazon AWS S3 Bucket in Java
Often we need to load up and read a value from a property file which is stored in a WEB-INF folder of our web app. In the below example I am going to share with you how to create a web service which accepts a key, reads key value from a property file and returns…
Read More Load Properties File from WEB-INF in JAX-RS Jersey App
Hibernate is a great framework to use to persist data into a database when building RESTful Web Services for your mobile application with Jersey and JAX-RS. In most of the projects I have participated when designing RESTful Web Services for Mobile App we used MySQL database server and Hibernate framework to store user data which…
Read More Persist Java Object in MySQL Database With Hibernate
To make our Jersey RESTful Web Service Application be able to @Autowire service classes and inject Java Beans we will need to add to it a support for Spring Dependency Injection(DI) and below I am going to share with you how to do it. To add Spring DI support to my JAX-RS application, I am…
Read More Add Spring Dependency Injection Support to a JAX-RS Jersey App