Flyway Logo

#HOWTO: Best Practices for Flyway and Hibernate with Spring Boot

Manually applying your database schema is cumbersome and error-prone. Fortunately, there are technologies for version-controlling your database scripts to automate this process across all environments. In the Java ecosystem, Flyway is one of the most popular and described as the following:   Version control for your database. Robust schema evolution across all your environments. With…

#HOWTO: Writing PostgreSQL functions with Java using PL/Java

The PostgreSQL RDBMS offers a great variety for writing server-side functions and with PostgreSQL 11 now also stored procedures. PostgreSQL comes with a language named PL/pqSQL which enhances plain SQL with control flow predicates and is similar to Oracle’s PL/SQL proprietary language. Besides this SQL-like language, PostgreSQL also offers built-in support for using Perl 5, Python and TCL as possible…

#HOWTO: Preview PDF files with React

In addition to my blog post #HOWTO: Up- and downloading files with React and Spring Boot, I want to show you a simple way to display PDF files in the browser with React. I’m using create-react-app to bootstrap the React application. For styling purposes I’ve added semantic-ui-react and semantic-ui-css. The library for previewing the PDF files is called react-pdf: {…

#HOWTO: MicroProfile JWT Authentication with Keycloak and React

For securing your enterprise applications you have several choices which require different configuration setups. Lately, the stateless approach is the de-facto standard for securing your microservice based landscape. With the choice, your applications don’t store session data as the client mostly sends a JWT token with each request and thus the applications know about his metadata…

#HOWTO: Convert .docx files to .pdf files format loss-free

Recently I had to convert generated .docx files to .pdf files for a more convenient distribution. The Word documents contained some custom formatting and additional pictures. I tried several Java libraries for doing this job (Docx4j, XDocReport and Apache POI) but all of them couldn’t generate the output I got from manually converting the .docx files with Microsoft Word’s native…

#HOWTO: Generate documents from Word templates with Docx4j on Wildfly 14

Lately, I had the requirement to generate Word documents from specific templates and fill them dynamically with data. For this task, I compared the following Java libraries: Apache POI, iText PDF, Docx4j and XDocreports.  I compared them while using the following characteristics: Possibility to replace variables, amount of additional dependencies, lines of code to generate…

#HOWTO: Simple form-based authentication for JSF 2.3 with Java EE 8 Security API

Securing your web application can be cumbersome. I recently tried to secure a JSF 2.3 application with the latest Java EE 8 Security API (JSR-375) and it was quite simple. In this blog post, I’ll show you the required configuration steps for securing your JSF application with a form-based authentication mechanism. In the example, I’ll use an…