How to customize Spring Security’s AuthenticationFailureHandler in a Spring Boot application?

We handle successful authentications by implementing the onAuthenticationSuccess() method of Spring Security’s AuthenticationSuccessHandler Interface. We write our own code to handle the activities and flow for successfully logged in users. Similarly we can handle the authentication failures using Spring Security’s AuthenticationFailureHandler Interface. Spring handles authentication failures and redirect users to the login page by itself […]

Continue Reading
Image can't be shown :(

What is Java Call Stack?

To start with, what does an Exception mean? It is an event that disrupts the normal flow of a program’s execution. When an exception is thrown from inside a method, the Java Runtime System attempts to find an ordered list of methods that had been called to reach the method where the error occurred. This […]

Continue Reading

What is Thread Scheduling in Java?

Execution of multiple threads/tasks on a single processor is called Thread Scheduling. Scheduling can mainly be of two types. 1) Preemptive scheduling 2) Time-sliced scheduling In Preemptive scheduling, the thread with the highest priority runs first. it keeps running until it reaches wait or dead stage or a higher priority thread comes. In Time-sliced scheduling, […]

Continue Reading

Primitive datatypes in java

8 primitive types in java are int, char, byte, float, double, boolean, short and long. Everything in java is not an object. Primitive datatypes are included in java for performance reasons. For primitive types, we don’t use the new keyword. Using new will place the objects in heap, which would be very costly for small […]

Continue Reading

Voice Recording and Playback in Java

You may need to integrate a voice recorder in to your application and play the recorded voice message later. Following is one of many options. Main java classes used to capture audio are, the following. AudioSystem AudioInputStream AudioFormat TargetDataLine DataLine.Info You will need to import javax.sound.sampled.* as these are included in javax.sound.sampled package. This package […]

Continue Reading