Using WebFlux with Spring Boot is straightforward and may not require changes when moving from Spring MVC. We will still use the same set of annotations like RestController and RequestMapping, to name a few. However, we use WebFlux to tap
Create Email in Spring Boot using Apache FreeMarker
Suppose our application needs to email in text or HTML format; how can we do that without changing a lot of codes? We use templates! Spring Boot makes it a lot easier working with Apache FreeMarker with FreeMarker Starter POMs.
Spring Boot Security Tests With PreAuth And WithMockUser
When we implement authorization in Spring Boot with Spring Security, for instance, using the PreAuth annotation, we should never skip automated tests for it. We could use the @PreAuth, among other annotations, to control authenticated users’ access to some methods
Headstart Framework: Flyway and Supported Databases
We have designed the Headstart framework to be database-agnostic to support major database products with the help of Flyway. To achieve this database agnosticism, Headstart uses Spring Data/Hibernate but relies on migration scripts for creating database tables. We run these
The Number of Entities In a Hibernate Persistence Context
One of my worries with Hibernate was the number of entities accumulating in a Persistence Context. If I were not careful, my codes could potentially store thousands of entities in a Persistence Context. Worse, these objects could stay in memory
How to use Hibernate JPA in a simple Application
This article demonstrates how to use Hibernate Entity Manager 4.3.7 in a simple application.
File Compression in Java with Apache Commons Compress
Apache Commons Compress can be downloaded from http://commons.apache.org/compress/
How To Use Java 8 Stream Reduce Example
This post shows how to use Java Stream Reduce with example codes. The idea of the reduce operation is the generation of a single result from a collection of values or objects. It is similar to the min and max operations
iReport 2.0.0 Page Numbers and Page Count
This post shows how to create a jasper report using iReport that displays page numbers and page count, e.g., 1/10. Moreover, the iReport will show the page numbers and page count on top of the pages. iReport 2.0.0 and other
Java 8 – Get my current timezone using ZonedDateTime
This post shows how to get your current timezone in Java using ZonedDateTime class. Get Current Timezone Using ZonedDateTime Since Java 8, it is possible to determine your current timezone using ZoneDateTime. Suppose you are in Singapore or thereabout; the