How to enable HTTPS in a Spring Boot Java application

how to enable HTTPS in Spring Boot - Thomas Vitale

Setting up HTTPS for Spring Boot is very easy, all you need to do is performing   the following operations:

  1. Generate a key-pair using the RSA algorithm;
  2. Generate an X.509 certificate using the keys from the previous step;
  3. Import the certificate inside the JRE archive for certificates;
  4. Set up Spring Boot to enable HTTPS.

To perform the previous operations I’ll use these technologies and tools:

  • Java JDK 8 (1.8.0_72)
  • Spring Boot 1.5.3.RELEASE
  • keytool

The last tool is provided together with the JDK, so if you have the JDK installed  you have keytoolalready available. To check it, try running the command keytool --versionfrom your Terminal prompt. Note that if you are on Windows, you might need to launch it from the \bin folder. For more information about it, you can read the official documentation.

Continue reading “How to enable HTTPS in a Spring Boot Java application”

Spring Data JPA using Hibernate and Java Configuration with Annotations

Spring Data JPA using Hibernate and Java Configuration - Thomas Vitale

In this tutorial I’ll show you how to use Spring Data JPA to integrate a relational database (PostgreSQL in my example) into a Spring Boot application.

I’ll use these technologies and tools:

  • Spring Tool Suite (STS) 3.8.4.RELEASE
  • Java 8
  • Spring Boot 1.5.3.RELEASE
  • Maven 3.3.9
  • PostgreSQL 9.6.2

1. The Project Structure

The final folder structure of our project.

The folder structure of the Spring Data JPA project as seen in STS

2. Create a new Spring Boot project

If you’re using STS, you can easily create a starter project by either selecting File > New > Spring Starter Project from the main menu or right-clicking on the Package Explorer and select New > Spring Starter Project. Continue reading “Spring Data JPA using Hibernate and Java Configuration with Annotations”

Getting Started with Spring Data MongoDB using Java Configuration

Spring Data MongoDB using Java Configuration - Thomas Vitale

In this tutorial I’ll show you how to use Spring Data MongoDB to integrate a MongoDB NoSQL database into a Spring Boot application.

I’ll use these technologies and tools:

  • Spring Tool Suite (STS) 3.8.4.RELEASE
  • Java 8
  • Spring Boot 1.5.3.RELEASE
  • Maven 3.3.9
  • MongoDB 3.3.4

1. The Project Structure

The final folder structure of our project.

The project structure of our Spring Data MongoDB Project as seen in STS Continue reading “Getting Started with Spring Data MongoDB using Java Configuration”

Getting Started With WordPress Plugin Development

"Harry Plugin & The Power of WordPress" written in the style of Harry Potter

This morning I gave a talk about how to get started with WordPress Plugin Development at WordCamp Torino 2017.

Here you can find the video and the slides of my talk, enjoy 🙂


WordPress Plugins are powerful tools that let us extend WordPress and turn it into whatever we want. What’s their secret? Join me if you want to know more about them and get started developing your own Plugin! I’ll tell you a story about magic, dangerous pirates, brave bowmen and ancient castles…

Introduction to WordPress Plugins

49 472 WordPress Plugins available on the official repository. That’s a huge number! And they are just the Plugins available on wordpress.org. They are much more, for example think about vendors that sell their own Plugins on their platforms or the thousands of Plugins loaded on GitHub, but never submitted to the official repository.

For many people Plugins are surrounded by mystery. It seems that WordPress provides us with a powerful magic wand to get anything we want. To turn WordPress into whatever we want.

What is a Plugin?

The shortest answer is: a package of code. More specifically, a package of PHP code. That’s it.

The simplest Plugin is made up of a single unique PHP file. For example Hello Dolly, a Plugin that you’ve probably never used, but you have seen it at least once, since it is delivered together with WordPress.

It’s important to understand how Plugins are related to WordPress itself. There are three major components: Core, Themes and Plugins. The Core is the application itself. Themes allow to display some data to users and to choose the look and presentation of your website. Finally we have Plugins.

Plugins are used to extend WordPress functionalities or to add new ones. At this point you can ask why not to directly modify the WordPress Core. Continue reading “Introduction to WordPress Plugins”

Pride and Prejudice. A WordPress Story

WordPress Logo over a split blue/red background

“It is a truth universally acknowledged, that each person in possession of a good website, must have used WordPress.”

That’s how our story begins, just like Jane Austen’s Pride and Prejudice. Join me on this journey through the World of WordPress! Get ready for exploring commonplaces, facing fearful stereotypes and rescuing users in danger until the untold secret will be unveiled… Continue reading “Pride and Prejudice. A WordPress Story”

How to setup gdb and Eclipse to debug C++ files on macOS Sierra

Using gdb debugger on macOS is no longer easy since Xcode stopped using it and replaced it with lldb. On macOS Sierra there are several steps to follow in order to make it work.

Install gdb

The easiest way to install gdb is by using Homebrew: “the missing package manager for macOS”. If you don’t have it installed, open your Terminal prompt and write this command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Once you have Homebrew installed, you can simply run:

brew install gdb

Now check gdb installation by running:

gdb --version

Take note of the version: you’ll need it later. Continue reading “How to setup gdb and Eclipse to debug C++ files on macOS Sierra”

Il Web ci rende liberi? Gianni Riotta e la dialettica della rivoluzione digitale

La copertina del libro "Il Web ci rende liberi?" di Gianni Riotta, pubblicato da Einaudi
“Il Web ci rende liberi?” di Gianni Riotta, pubblicato da Einaudi

Il Web ci rende liberi? è l’ultimo saggio scritto dal professor Gianni Riotta, che s’interroga sulla domanda che dà il titolo al libro e prova a fornire una risposta soddisfacente. È un’analisi brillante e coinvolgente, in cui Riotta considera tutte le categorie della cosiddetta ‘Rivoluzione Digitale’ con rigore e lucidità intellettuale, senza pregiudizi o affrettate posizioni di parte. Solo nell’ultimo capitolo, infatti, l’autore rivela la sua posizione e spiega perché non si è schierato con le teorie analizzate nel corso della trattazione.

Pur non rivelando da subito la sua posizione, il saggio non è freddo o impersonale, ma è caratterizzato dalle esperienze autobiografiche dell’autore, che costituiscono la base degli argomenti trattati. Riotta, infatti, scrive spesso di come ha vissuto le novità nel campo delle tecnologie della comunicazione, rivela le prime impressioni, perplessità e sogni sul futuro di questi nuovi strumenti. In questo modo coinvolge emotivamente il lettore, che percepisce come la Rivoluzione Digitale abbia influito realmente sugli individui.

‘Individuo’ è una delle parole chiave del libro. Più volte l’autore sottolinea il passaggio dal secolo delle Masse, il Novecento, al secolo dell’Individuo, della Persona: il ‘secolo Personal’. Proprio dall’individuo bisogna partire per intraprendere il percorso di comprensione del Web. Scrive Riotta: “Dobbiamo guardare a noi, gli artefici e artigiani della tecnologia, prima che al software e all’hardware”. Continue reading “Il Web ci rende liberi? Gianni Riotta e la dialettica della rivoluzione digitale”