In my Stripes app I define the following class:
MyServletListener implements ServletContextListener, HttpSessionListener, HttpSessionAttributeListener {
p
Something like this should work:
public class MyServletListener implements ServletContextListener, HttpSessionAttributeListener, HttpSessionListener {
@Autowired
private SomeService someService;
@Autowired
private AnotherService anotherService;
public void contextInitialized(ServletContextEvent sce) {
WebApplicationContextUtils
.getRequiredWebApplicationContext(sce.getServletContext())
.getAutowireCapableBeanFactory()
.autowireBean(this);
}
...
}
Your listener should be declared after Spring's ContextLoaderListener in web.xml.