RESTEasy (WildFly – JAX-RS 2.1) file handling

In my latest blog post, I demonstrated a solution for up- and downloading files with Jersey (JAX-RS 2.1) on Payara. As WildFly does not rely on Jersey as the JAX-RS reference implementation and is using RESTEasy instead, I’ll show you a quick example for file handling with RESTEasy on WildFly. Setting up the backend using

Read More

Up- and download files with Java EE and Web Components

In one of my last blog post, I showed you how to upload and download files with React and Spring Boot. Today I want to give you a quickstart example on how to achieve the same with Java EE and Web Components (standards ftw!). In this blog post, I’ll be using Java 8, Java EE

Read More

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 a perfect fit alongside Hibernate and Spring Boot.  Flyway is described as the following: Version control for your

Read More

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 (similar to Oracle’s PL/SQL). Besides this SQL-like language, PostgreSQL also offers built-in support for using Perl 5, Python and TCL as possible languages to implement functions

Read More

Generate PDF documents with Charts using Java EE and ApachePDFBox

Generating documents for e.g. invoices or reports is a central use case for enterprise applications. As a Java developer, you have a wide range of possible libraries to manipulate and create Word, Excel or PDF documents. To help you choose the right library, I’ll demonstrate an example to generate PDF documents with Java EE. This requires

Read More

Preview PDF files in the browser 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:

Read More

Simple database documentation with SchemaSpy

Recently I was looking for a simple solution to generate visual documentation of the underlying database. The solution should be easy to use, database vendor-independent and automatable e.g. during the CI pipeline. Therefore I found SchemaSpy (GitHub – Homepage) which is a single jar file and is able to generate nice-looking web-based documentation like the following: Sample

Read More

Bootstrap a JSF 2.3 Maven project in seconds

Bootstrapping a new JSF can be quite cumbersome if you are new to Java EE. Even after weeks of training, I had to look up the anatomy of the or the correct folder structure. As the JSF technology is still a valid and reasoned choice for frontend development in enterprises, I’ve created a simple Maven archetype

Read More

Dynamic SQL Querying & Pagination with Querydsl and Spring Data JPA

Returning all the data in a table within a REST call can be slow if your table grows. Imagine a simple HTML <table></table> to show all the registered persons in your database. Even if you could return the whole dataset within one HTTP request, the user wouldn’t be able to read them all at once as he

Read More

JPA integration tests with Java EE

Writing good unit tests for your central business logic is essential. Both to speed up your development and have confident deployments to production. But there are also parts of your application where plain unit tests with mocking frameworks like Mockito aren’t that useful or result in a “mocking-hell”. The interaction of your application with your

Read More