public static ApplicationContext findApplicationContext ( ServletContext servletContext ) { if ( servletContext == null ) { return ContextLoader . getCurrentWebApplicationContext ( ) ; } return WebApplicationContextUtils . getWebApplicationContext ( servletContext ) ; }
Locates the ApplicationContext returns null if not found