Spring – How to do dependency injection in your session listener
Spring comes with a “ContextLoaderListener” listener to enable Spring dependency injection into session listener. In this tutorial, it revises this HttpSessionListener example by adding a Spring dependency injection a bean into the session listener. 1. Spring Beans Create a simple counter service to print total number of sessions created. File : CounterService.java package com.mkyong.common; public …