How to Create Custom Namespaces and Handlers in Spring

Custom namespaces in spring are a way to replace the complex bean definitions with a more user-friendly configuration.

Spring itself provides several namespaces out of the box. e.g.

Localization with Spring

Localization enables applications to cater to users of different locations and languages. Spring, as usual, has support for this aspect as well.

Before jumping into what Spring has to offer, let's explore what we get from Java itself.

Spring Boot - How to Create a Deployable War

Spring boot, by default, enables you to create standalone applications through simple, minimal configurations. And due to its self-contained nature, it naturally enables building microservices.

Spring starters are poms (if using maven) that

Spring Cache - Part 5 - CacheEvict

In the Spring Cache series so far (Part1, Part2, Part3, Part4), we have seen examples where the data is getting added to the cache through the use of @Cacheable and @CachePut. But, what about removing data from cache? Consider a call to delete the record from Service or DB, in which case, we would also want to delete that record from the cache.

Deep Copy Java Objects through Serialization

When it comes to deep copy or cloning an object, the first thing that comes to mind is to override the clone() method and set each field manually. This can be pretty cumbersome to implement for complex objects or if you have to do this for a lot of them.

Spring Cache - Part 4 - CachePut


There are scenarios, unlike retrievals, where you do not want to skip the execution of the method e.g. insert/update of a record. Such methods should not be marked as Cacheable. But, you might still want to cache the result of these methods, in order to avoid unnecessary retrievals in future calls.

Spring Cache - Part 3 - Conditional Cache


In this part of the tutorial, we will see how data can be cached conditionally. (If you haven't checked the previous parts, please visit Part 1 and Part 2. They contain sample code that the examples below refer)

Spring Cache - Part 2 - Cache Keys

In part 1 of the post, we looked at how data can be cached through simple configuration. In this part, we are going to explore the cache keys.