Spring: Big Picture

What is Spring? Spring makes it easy to create Java enterprise applications.It is a complimentary to Java EE. Spring is open source. It has a large and active community. Spring 5.0 requires JDK 8+ and provides out-of-the-box support for JDK 9. Fundation: Spring Framework The Spring Framework is an application framework and inversion of control container for the Java

Read More

Useful commands for SSL certificates

Generate self signed certificate and export to truststore 1. Generate a certificate using keygen command in windows keytool -genkey -alias myAlias -keyalg RSA -sigalg SHA256withRSA -keystore keystore.jks -validity 10950 2. Self certify the csertificate keytool -selfcert -alias mycert-20161109 -keystore keystore.jks -validity 3950 3. Export certificate to folder keytool -export -alias myAlias -keystore keystore.jks -rfc -file

Read More

Linux commands

Linux commands that I frequently use Open a file sudo vim server.log Open a log file and display the last 10 lines tail -f /opt/keycloak/standalone/log/server.log Exit vim without saving Press Esc Press “:” Press “q!” Save and exit vim Press Esc Press “:w” Press “:x” Create new file $ cat > daemon.json CTRL + D

Read More

Dockerizing Spring Boot Application

In my previous post, I mentioned about How to run docker container on your local machine. This post is about the dockerizing backend part of the Nutrition Tracking Application. We will follow these steps: Building Spring Boot project Writing a Dockerfile Building and running docker image Step 1: Building Spring Boot project mvn clean packagewill produce a

Read More

Java 8 Optionals for Null Objects

In my previous post, I mentioned about refactoring techniques including testing interface for null checks. I have recognized that there is an alternative for it while reading Java 8 in Action: Lambdas, streams, and functional-style programming. Optional Class If there is an object that might contain a null value, we can use Optional to wrap the

Read More

Inner Classes

Hi, This post is about Inner Classes, which could be useful when you are learning Lambda Expressions and Functional Programming in Java 8. Member Inner Class They can access private variables of outer class. public class MemberInnerClass { private int outer = 5; class Inner { private int inner = 10; public void print() {

Read More

Class Initialization

Today, I will briefly mention about the class initialization. When we execute any java program (e.g.: java InitTest), Java Virtual Machine loads and link the class, execute initializers, and invokes the main class. Initialization process has some rules. Before we go into the details, spend a few minutes to figure out the output. class SuperClass { static { System.out.print(“0

Read More

Core Java APIs

Hi, In this post, I will cover a some of the Core Java APIs (String, StringBuilder, Wrapper classes, and Date Time API) that we are responsible for Java 8 Programmer I exam. Immutability I think the first thing that we need to know is immutability. String class is immutable, meaning that the state of the

Read More

Java Exceptions

Hi, This section is about exception handling in Java. I will try to cover as much use cases as I can. The best way to learn exceptions is to play with different exception types, especially handling multiple exceptions, by yourself. We are responsible for following specific classes for Java 8 Programmer I exam: Error, Unchecked

Read More