Handling Date objects in Thymeleaf

In this post, We will see how to format and work with date objects in thymeleaf templates using the #dates utility with an example. Introduction Before getting in further, read a little about thymeleaf and how it can help build dynamic web applications. The #dates object in thymeleaf deals with date objects in thymeleaf model….

Derby Embedded Database for Spring Boot

In this post, We will see how we can use Apache Derby embedded database with Spring Boot applications with an example. Introduction Apache Derby is a pure java implementation of a relational database. Also, it complies with JDBC and RDBMS standards. For this reason, we can easily embed Derby into applications. Derby Dependencies for Spring…

Spring Boot Interview Questions 2021

Let’s go through some of the important Spring Boot interview questions for beginners. We gathered these questions from some of the top MNCs across the globe. What is Spring Boot? Spring Boot is an opinionated view of the Spring ecosystem and third-party libraries to kickstart an application development with ease. Spring Boot makes this possible…

Comparators and equality in Thymeleaf

Even though we do not pay attention to these operations much, Comparators and equality operators are the key aspects in thymeleaf expressions. In this post, we will see how these operators can be used. Comparison Operators (Comparators) You can compare values and expressions using the >, <, >= and <= Comparators. These operators behave the same way as they would behave in most…

Thymeleaf Expressions in Spring Boot

Thymeleaf let us create dynamic views via extensive use of expressions in the template files. The simple form of expressions fall into four main categories. Variable expressions Variable expressions are the most commonly used ones in thymeleaf templates. These expressions help bind the data from the template context(model) into the resulting html(view). For example, The…

Thymeleaf Literals and Constants in Spring Boot

In this post, We will see how to use String literals,numeric and boolean constants in thymeleaf templates with an example in a spring boot application. Spring Boot can support any primitive data type to be a literal in an expression. To clarify, all number types, Char types, boolean type and ofcourse strings. Text literals in…

Thymeleaf Fragments in Spring Boot Application

Thymeleaf fragments let you break down your templates into reusable layout elements. For example, Several pages may have different content but still have the same header and footer. In these cases, Writing these into a separate template file and reusing it is not a bad idea. Fragments in Action Let’s take this snippet from a…

Thymeleaf Form POST Handling in Spring Boot

In this post, we will take a look how to handle form POST request submission from thymeleaf template in Spring boot and how to bind form elements to a Model object. Typical Form handling For applications that use Thymeleaf views, AJAX may be overkill. But form handling is not simple. At least in the context…

Spring Boot Hazelcast Cache – Guide

This is a complete guide for using Hazelcast as cache backend in your spring boot application with an example. What is Hazelcast? Hazelcast (Hazelcast-IMDG) is an in-memory data grid. The ideal use-case for Hazelcast-IMDG would be store and replicate cached content between applications. The grid itself is a collection of embedded instances of Hazelcast runtime. Many of…

Spring sessions in a Separate Database

Storing session details in Redis or database is usually a good idea. However, the default implementation of spring-session-jdbc uses the primary data source to store and retrieve data from the session related tables. This can be a problem when there is a large amount of session related operations to the database. To avoid these situations,…