Category: JAVA
-
Java 16 logging
One of the features I liked in Java16 are the logging changes. The updated logging API works on handlers. There are different handlers FileHandler, MemoryHandler and ConsoleHandler. Depending on the need, these handlers can be configured in runtime. Here is a scenario., if you want to debug or pipe entry of the logging information going…
-
Effective Java – Third edition
Effective Java is always a good book to read and this latest edition is no different. Here is the Amazon link to get the book. Here are some code samples and presentation promoting the book. My quick code snippet from the book. import java.util.Arrays; import java.util.Collections; import java.util.List; public class StringManipLambda { public static…
-
Quickest way of getting an custom error message in Spring Boot 2.x
There are different ways to get a custom error message page in spring boot. The following solution worked for my web project. Here is the overview of the structure. Pic To start with, if there is 404 error, then we want a custom error page showing up instead of the spring boot’s default page. The…
-
Spring 5 and JUNIT.
Let us try to put together some JUNITs with Spring 5 injection. One of the most challenging things of integrating JUnit and Spring was the role of the IDE. It is important to keep an eye on that. So here is the code we are going to look. @RunWith(SpringJUnit4ClassRunner.class)@ContextHierarchy({ @ContextConfiguration(classes = StreamsConfig.class)}) public class StreamsFilterSampleTest…