Created
December 17, 2014 05:49
-
-
Save tag1216/4591d421802861c37dd5 to your computer and use it in GitHub Desktop.
SpringでいつでもどこでもApplicationContextを取得する
This file contains hidden or 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
@Component | |
public class ApplicationContextProvider implements ApplicationContextAware { | |
private static ApplicationContext context; | |
public static ApplicationContext getApplicationContext() { | |
return context; | |
} | |
@Override | |
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | |
context = applicationContext; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment