Spring Boot: Thymeleaf Template Decorator Using Thymeleaf Layout Dialect

Introduction The question on reusing header and footer on all Thymeleaf templates has been often been asked on StackOverflow. In this article, I will show you how you can structure the templates using the Thymeleaf Layout Dialect to achieve a higher code reusability in a Spring Boot application. Create a Spring Boot Application Lets use … Read more

Java Interface – Journey Over the Years to Java 9 – Default and Private Methods

Introduction Interface in Java has evolved over the Java releases more so in Java 8 and Java 9. In this article we will look at how Interface was prior to Java 8 and how it has been enhanced in Java 8 and Java 9 Interface prior to Java 8 An interface would have one or … Read more

Configure Embedded H2 Console With Spring MVC Application

In our previous post we deployed a Spring MVC app using embedded H2 database to Tomcat. Browsing the data in an embedded DB is difficult because we cannot connect an external client to view the data. H2 provides a Web console which we can enable and use this to browse the data as shown below: … Read more

How to Deploy Spring Application Without web.xml to Tomcat

Introduction Since the Servlet 3 specification web.xml is no longer needed for configuring your web application and has been replaced by using annotations. In this article, we will look at how to deploy a simple Spring-based application without web.xml to Tomcat 8.5.*. Creating an Empty Application Use the following command to create an empty web … Read more

Using Google reCaptcha with Spring Boot application

Introduction reCaptcha by Google is a library used to prevent bots from submitting data to your public forms or accessing your public data. In this post, we will look at how to integrate reCaptcha with a Spring Boot based web application Setting up reCaptcha You should create an API key from admin panel. You have … Read more

Using Mustache.js for Client-Side Templating

Introduction In this article, I will show you how to make use of Mustache.js for client-side templating. In this approach, we get the JSON data from an API, developed by you or a 3rd party API and build the HTML required for rendering the data at the client side. We will make use of GitHub … Read more

Aggregate and Index Data into Elasticsearch using Logstash, JDBC

Introduction In my previous posts here and here I showed you how to index data into Elasticsearch from a SQL DB using JDBC and Elasticsearch JDBC importer library. In the first article here I mentioned some of the shortcomings of using the importer library which I have copied here: No support for ES version 5 … Read more

My First book Java 9 Cookbook, Packt Publications – Over 100 Java recipes covered

  Packt Publications recently published Java 9 Cookbook co-authored by me along with my co-author, a seasoned developer, Nick Samoylov. Yes!! This is my first publication and hopefully first of much more to come. We have tried to cover as many recipes as possible covering new features in Java 9 namely: Module System and tools around … Read more

Book Review: Murach’s Javascript and jQuery 3rd Edition

Murach’s Javascript and jQuery is a book useful for those who are beginning to learn Javascript and would want to try out jQuery as well. This book is divided into three sections: The first section is an introduction to Web and Javascript The second section is all about jQuery And the third section is some … Read more

WebUI Popover – Useful wrapper over Bootstrap Popover

Github Project page: WebUI Popover. Some of the examples: To create a closeable popover: $(“#popover-elem”).webuiPopover({ content: “Closeable content”, title: “Closeable”, closeable:true }); To create a non-dismissable popover: $(“#popover-elem”).webuiPopover({ content: “Non dismissible content”, title: “Non dismissible”, dismissible: false }); Handling popover events $(‘#popover-elem’).on(‘shown.webui.popover’, function () { console.log(“Shown event!!!”); }); Few more examples can be found in … Read more