Docker Useful Commands

Nov 06, 2018

This article shows a curated list of docker commands that may be useful.... Read more

Overwriting Spring Security Context through Filter

Oct 30, 2018

This article presents a strategy that overwrites the spring security context in order to allow a user to visit the resources without authenticating the user through the authentication filters. ... Read more

IE Won't Set Cookie

Oct 30, 2018

This article shares a different behavior in IE than Chrome when expecting to set a cookie.... Read more

Spring Data MongoDB GridFS 3.4

Oct 17, 2018

This article shows a typical usage of MongoDB GridFS with Spring Data MongoDB. This is for MongoDB java driver v3.4 and Spring Data MongoDB v1.10.x. Note that Spring Data MongoDB v2.X introduces breaking changes with the MongoDB java driver 3.6+. Thi... Read more

Handle Non-encoded Request URL

Oct 14, 2018

Normally we need to encode the request URL from the client before sending a request to the server, but there may be just one time that you really can't enforce the client to encode their request URL and sometimes it contains special characters that w... Read more

Tomcat Invalid Character in Request

Oct 10, 2018

8.5 Tomcat throws an `IllegalArgumentException` when processing request URL that has non-encoded illegal special characters. This article shows two workarounds.... Read more

Spring Data Repository Query Precedence Tricks

Oct 10, 2018

Spring Data repository method is very handy but it also comes with its limitation, especially when composed with condition precedence. This article shows one way to work with it and its caveats.... Read more

Entity Graphs for Lazy Loading

Oct 10, 2018

*Entity Graphs* are templates for persistence query. One common problem it solves is *Lazy Loading*. This article introduces the basics of *Entity Graphs* and how to use *Entity Graphs* with *JPA* and *Spring Data* to solve the *Lazy Loading*.... Read more

PostgreSQL and Hibernate CLOB

Oct 10, 2018

When you need a SQL data type that can hold more than 255 characters, you are likely to use some large character data type such as CLOB, BLOB. It is easy to find the right type if you know what exactly the database you will stick to. However, when we... Read more

Entity Mapping with Inheritance in Hibernate

Oct 10, 2018

Inheritance could be enabled in Hibernate with the `@MappedSuperclass` annotation. This annotation could greatly reduce the boilerplate in our entity mapping.... Read more