Category: Uncategorised

Display the contents of an excel using Thymeleaf

Thymeleaf is a server-side templating engine that integrates seamlessly with Spring Boot. It allows to create dynamic web pages by embedding dynamic content directly into HTML templates. Thymeleaf templates are often used to render data from the server to the client, making it a popular choice for building web views in Spring Boot applications. Here’s […]

Split an excel to multiple excel files in Java

In this blog we will see how to split an excel into multiple excel files using Apache POI library. Apache POI provides a comprehensive set of APIs for more advanced operations on Excel and Word documents, making it a powerful tool for handling office documents in Java applications. Apache POI (Poor Obfuscation Implementation) is a […]

Spring Data JPA many to one mapping & Integration test

In this blog we will see Spring Data JPA many to one relationship example and also how to write integration test for the same. In Spring Data JPA, the “Many-to-One” relationship is used to establish an association between two entities where multiple instances of one entity are associated with a single instance of another entity. […]

Spring Boot App metrics with Micrometer and New Relic

In this blog we will see how to send metrics created using micrometer to new relic. We can create the spring project using Spring initializr with the dependencies as shown below Next define a simple REST API Configure application.properties to enable endpoint and export to new relic From the logs we could see metrics being […]

Spring Boot App Metrics with Micrometer and Prometheus 

Observability, in the context of computer systems and software development, refers to the ability to gain insights into the internal state and behavior of a system based on the external outputs, metrics, logs, and traces it generates. Key components of observability include: In this blog we will see how to generate metrics which is one […]

Java MalformedInputException: Input length = 1

As part of this blog lets go through when this exception occurs and how to fix it. When any of the methods of java.nio.file.Files class is used to read the file contents it assumes the file is encoded using UTF-8. If file is encoded in different format and when we try to read the file […]

Search for a file and print its contents

In this post we will see how to search for a file in java and read the file to print its contents. proverbs.txt is the file we are going to search and it is located in the directory D:\1\2\3 In the above code we use Files.find() the find the exact path of the file and […]

Running Spring REST API as a container using Docker Desktop

In this post we will see how to build a docker image for the spring REST API and run it as a container. Before seeing the details of building docker image we will see how to do maven build for the Spring boot REST API and run the app from command line. For this exercise […]

Data Analysis using Python

Before getting started with Data analysis we will get to know a little about Jupyter Notebook and Google colab. Jupyter Notebook is a web-based interactive computing platform that combines computer code, plain language descriptions, data, rich visualizations like 3D models, charts, graphs and figures, and interactive controls. Google Colab is a hosted Jupyter Notebook service […]

Try with Resources

Developers who have used sonar for code analysis would have seen this check Try-with-resources should be used. Try-with-resources statement was introduced in Java 7 which guarantees that the resources will be closed. Lets see this in detail using the below example. In the above code we could see logic to read a file and print […]