Checking whether password contains username or not

In this post under Passay, I will show with example the purpose and how to use “UsernameRule” class. When a user register on a website they come up with username and password. They tend to create a password that is easy to remember for example using DOB as password, nick name as password etc. Sometimes…… Continue reading Checking whether password contains username or not

Chaining multiple application event listener

In previous post under Spring Core, I showed1) how to listen for events generated from application context2) how to generate and listen for custom application event. In this post, I will show with example how to chain multiple event listener for a particular application event For our example, I will take “ContextStoppedEvent” event which is…… Continue reading Chaining multiple application event listener

Generating Custom application events

In this post under Spring Core, I will show with example how to create custom application events. For our example, I created a custom event that the application will generate as shown below CustomEvent package package32; import org.springframework.context.ApplicationEvent; public class CustomEvent extends ApplicationEvent { public CustomEvent(Object source) { super(source); } } In the above code,…… Continue reading Generating Custom application events

IllegalCharacterRule example

In this post under Passay, I will explain with example the purpose and how to use “IllegalCharacterRule” class. In the previous, I explained the purpose of “AllowedCharacterRule” class. The class “IllegalCharacterRule” is the opposite of “AllowedCharacterRule”. In “AllowedCharacterRule” we create an array of characters that should be allowed in the password text. In other words…… Continue reading IllegalCharacterRule example

Listening to ApplicationContext events

In this post under Spring Core, I will explain with example how to listen to ApplicationContext events. The Spring framework when creates/stops/refresh an ApplicationContext, it generates certain events and we as a developer can listen to those events and add our custom logic so that it can be executed. For our example, I will create…… Continue reading Listening to ApplicationContext events

Using filters to customize @ComponentScan annotation

In one of my previous posts under Spring Core, I explained the purpose of “@ComponentScan” annotation with example. For recap, “@ComponentScan” annotation when applied at the class level with an package name as an argument tells Spring framework to scan for class files annotated with “@Component” annotationunder the specified package folder. It scans the subfolders…… Continue reading Using filters to customize @ComponentScan annotation