Created
February 22, 2016 06:53
-
-
Save zhentao/20a7738ea6d4659d8cdc 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
@Override | |
protected SparkApplication getApplication(FilterConfig filterConfig) throws ServletException { | |
Class<?>[] configClasses = getConfigClasses(filterConfig); | |
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(configClasses)) { | |
String applicationClassName = filterConfig.getInitParameter(APPLICATION_CLASS_PARAM); | |
try { | |
return (SparkApplication) context.getBean(Class.forName(applicationClassName)); | |
} catch (ClassNotFoundException e) { | |
throw new ServletException(e); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment