In my Stripes app I define the following class:
MyServletListener implements ServletContextListener, HttpSessionListener, HttpSessionAttributeListener {
p
Little bit shorter and simpler is to use SpringBeanAutowiringSupport class.
Than all you have to do is this:
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
So using example from axtavt:
public class MyServletListener implements ServletContextListener, HttpSessionAttributeListener, HttpSessionListener {
@Autowired
private SomeService someService;
@Autowired
private AnotherService anotherService;
public void contextInitialized(ServletContextEvent sce) {
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
}
...
}