JAVA

Reflection in Java

Overview In this blog we will cover following points What is Reflection API. Using private methods Using private fields Sample Code Reflection API Reflection allows instantiation of new objects, invocation of methods, and get/set operations on class variables dynamically at run time without having prior knowledge of its implementation. Real World Example: Take for example your typical web.xml file. This will contain a list of servlet elements, which contain nested servlet-class elements. The servlet container Read more…

By Ashish, ago
JAVA

What is JAX-RS

Overview In this blog we will cover What is JAX-RS JAX-RS Specification Implementation provider for JAX-RS Why follow JAX-RS What is JAX-RS JAX-RS: Java API for RESTful Web Services (JAX-RS) is a Java programming language API spec that provides support in creating web services according to the Representational State Transfer (REST) architectural pattern. JAX-RS 2.0 was released in May 2013. JAX-RS 2.1 was released in Sep 2017. JAX-RS Specification JAX-RS provides some annotations to aid in mapping Read more…

By Ashish, ago
JAVA

JVM, JDK, and JRE

Overview In this blog we will cover following points What is JVM, JRE & JDK Steps to run a java file JVM (Java Virtual machine) JVM is responsible to converting Byte code to the machine specific code. JVM is also platform dependent and provides core java functions like memory management, garbage collection, security etc. JRE (Java Runtime Environment) Java Runtime Environment is the implementation of JVM, it provides platform to execute java programs. JRE consists Read more…

By Ashish, ago
Git

Configure Git for Pull and Push

Overview In this Blog we will see how to configure and use Git to Pull and Push Data. Assumption:  Git is already installed in your Machine. If not, you can refer to Install Git on Linux, Mac or Windows Download Project from Git Repository (Github/Bitbucket) There are 2 ways to use Git => SSH/HTTPS SSH You need to add your SSH key to Github or Bitbucket Account. In order to Pull/Push repository. Your key will be Read more…

By Ashish, ago
Git

Install Git on Linux, Mac or Windows

Windows Setting up Git on Windows OS is pretty simple. You will need to download the installer from Git website Run the downloaded .exe file. Follow the instructions in Dialog. It is strongly recommended that you keep the default settings. After installation is done. You can manage your git repository by Git GUI or can use Terminal. You can open a terminal/command prompt and check git –version to see if Git in installed correctly. Mac OS Read more…

By Ashish, ago
JAVA

Java Application Performance Management (APM)

This blog will cover What is APM Glowroot – Overview Configuration – Embedded Collector Persistence Option with Docker – Central Collector What is APM? In production environment its important to keep an eye on the resource consumption. This is where various monitoring tools comes in. When it come to Java there are various open source monitoring tools. One of which is Glowroot. I personally like this one because of its simplicity and ease to configure. Read more…

By Ashish, ago
JAVA

Use GSON for Serialization and Deserialization

We will cover how to use Gson to convert JSON into Java Object and Java Object into JSON in following points Overview Use Gson – Maven/Gradle Object to JSON JSON to Object TypeToken Custom variables naming JSON with HTML content JSON in Readable format Fields from JSON Include Null Fields Overview Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert Read more…

By Ashish, ago
SSL Certification

Install SSL Cert for Free

If you have a Domain which doesn’t have SSL certification. You can set up SSL certification for free. In short what we will be doing is Using zerossl site we will generate SSL cert files. Using cPanel Dashboard we will activate SSL. Finally we will add redirect logic to move from http to https. Note:  I have tried this on GoDaddy web hosting using cPanel. Step 1: Goto this site : https://zerossl.com/ Click on Online Tools button  => FREE SSL Read more…

By Ashish, ago
JAVA

Static keyword in Java

Static keyword can be used with class, variable, method and block. Static members belong to the class instead of a specific instance, this means if you make a member static, you can access it without object. Static Block Static block is used for initializing the static variables.This block gets executed when the class is loaded in the memory. A class can have multiple Static blocks, which will execute in the same sequence in which they Read more…

By Ashish, ago
Javascript

Read JSON in Javascript

In this blog we will see how to read a complex Json having Arrays and sub JSON block. JSON basically consist of Array => [ ] and Curly Braces => { } Reading JSON will be easy to understand if we go step by step Let’s start with a simple JSON object Now lets see combination of above examples Let’s say I need value of following attributes firewallName lstRouterEntries : name routeEntry : name Let’s Read more…

By Ashish, ago