I would like to inject a dependency into a ServletContextListener. However, my approach is not working. I can see that Spring is calling my setter method, but l
I resolved this by removing the listener bean and creating a new bean for my properties. I then used the following in my listener, to get the properties bean:
@Override
public void contextInitialized(ServletContextEvent event) {
final WebApplicationContext springContext = WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
final Properties props = (Properties)springContext.getBean("myProps");
}