This is a space that holds a collection of my personal work and ideas
  • Efficient Text Highlighter
  • Implement the Lightning Algorithm
  • Build a markdown notes taking app
  • Serve Images in Next-gen Formats
  • Package-lock.json Explained

Docker Useful Commands

11/06/2018

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

Read more

Overwriting Spring Security Context through Filter

10/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

Spring Data MongoDB GridFS 3.4

10/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+. This article only shows the usage of the v3.4 driver with Spring Data MongoDB v1.10.x.

Read more

Handle Non-encoded Request URL

10/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 will make the server mark them as illegal characters in the request. This article shows an example of how to use a filter to preprocess the request on the server side.

Read more

PostgreSQL and Hibernate CLOB

10/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 use Hibernate, it provides the annotations that support the cross-platform data type translation.

Read more

Spring Data Repository Query Precedence Tricks

10/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

Tomcat Invalid Character in Request

10/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

Batch Patterns in WebMethods

10/10/2018

Having been working with WebMethods Integration Platform from Software AG for about a year now on a large integration project with many vendor components such as SAP, CityWorks, ArcGIS Server, from knowing nothing about WebMethods to building reliable and robust integration services, following established patterns is inescapable. However, the access to the proprietary software WebMethods and its documentation is limited to the public, we found a hard time to find the best practice for our batch operations. This article shows some patterns we learnt and tested with confidence that you might find helpful in your development with WebMethods.

Read more

Entity Graphs for Lazy Loading

10/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

Entity Mapping with Inheritance in Hibernate

10/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