AEM Code Snippets : How to get Page object based on path ?

 

In this code snippet, I am going to explain how to get page object by passing page path, in the activate method get the path and assign it to the local variable, you need to pass this local variable …

Exception handling in Java

 

What happens when the program or software throws several errors or not responding to end user while using software which was built by you, the people who are using your software gets frustrated and they will not come back to …

Java try-catch block

 

In my previous article, I have explained about exception handling, in this article, I am going to explain to you how to use try-catch block in Java

Let me take a simple example, the code which you see below will  …

Java multiple catch blocks

 

In my previous article, I have explained about java try-catch block, in this article, I am going to cover how to use multiple catch blocks in Java exceptions handling

You can handle multiple exceptions by using multiple catch blocks, but …

Java : Log error messages with Log4j

In this article, I am going to cover how to log error messages, here I am using log4j logging framework, first you need to update POM with the below dependency

Step 1:

Java custom exception class

 

In this article, I am going to explain to you how to write custom exception class or user-defined exception, the custom exception class should extend from Exception, here instead of using FileNotFoundException I am using custom new ExcelFileNotFoundException class

User-defined exception:…

Java try with resources

 

In my previous article, I have explained how to use try-catch-final in java,  in this article I am going to cover  try-with -resources which is an automatic resource management in Java Exception handling

The try-with-resources is introduced in …