Created
January 27, 2009 23:30
-
-
Save danilat/53639 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ApplicationContext getApplicationContext(HttpSessionEvent event){ | |
ServletContext servletContext = event.getSession().getServletContext(); | |
ApplicationContext context = (ApplicationContext) servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); | |
return context; | |
} | |
public void sessionCreated(HttpSessionEvent event) { | |
TestService testService = (TestService) getApplicationContext(event).getBean("testService"); | |
//.... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment