本文整理了Java中org.springframework.web.WebApplicationInitializer.onStartup()
方法的一些代码示例,展示了WebApplicationInitializer.onStartup()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebApplicationInitializer.onStartup()
方法的具体详情如下:
包路径:org.springframework.web.WebApplicationInitializer
类名称:WebApplicationInitializer
方法名:onStartup
[英]Configure the given ServletContext with any servlets, filters, listeners context-params and attributes necessary for initializing this web application. See examples WebApplicationInitializer.
[中]使用初始化此web应用程序所需的任何servlet、筛选器、侦听器上下文参数和属性配置给定的ServletContext。请参见示例WebApplicationInitializer。
代码示例来源:origin: spring-projects/spring-framework
AnnotationAwareOrderComparator.sort(initializers);
for (WebApplicationInitializer initializer : initializers) {
initializer.onStartup(servletContext);
代码示例来源:origin: BroadleafCommerce/BroadleafCommerce
@Override
public void contextInitialized(ServletContextEvent event) {
try {
ServletContext servletContext = event.getServletContext();
Class<WebApplicationInitializer> initializerClass = getInitializerClass(servletContext);
WebApplicationInitializer initializer = createInitializer(initializerClass);
initializer.onStartup(servletContext);
WebApplicationContext rootContext = (WebApplicationContext) servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
if (rootContext != null) {
delegateListener = new ContextLoaderListener(rootContext) {
@Override
public void contextInitialized(ServletContextEvent event) {
// initionally umimplemented since it has already initialized
}
};
}
} catch (ServletException | ClassNotFoundException | LinkageError | PrivilegedActionException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.springframework/spring-web
AnnotationAwareOrderComparator.sort(initializers);
for (WebApplicationInitializer initializer : initializers) {
initializer.onStartup(servletContext);
代码示例来源:origin: com.graphaware.neo4j/server
@Override
public void contextInitialized(ServletContextEvent sce) {
try {
initializer.onStartup(sc);
} catch (ServletException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: com.graphaware.neo4j/server-common
@Override
public void lifeCycleStarting(LifeCycle event) {
try {
initializer.onStartup(sc);
} catch (ServletException e) {
throw new RuntimeException(e);
}
}
}
代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-server
@Override
public void lifeCycleStarting(LifeCycle arg0) {
// WebAppInitializer initializer = new WebAppInitializer();
try {
Context servletContext = webAppContext.getServletContext();
// servletContext.setExtendedListenerTypes(true);
initializer.onStartup(servletContext);
} catch (ServletException e) {
throw new RuntimeException(e);
}
}
});
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
@Override
public void lifeCycleStarting(LifeCycle arg0) {
// WebAppInitializer initializer = new WebAppInitializer();
try {
Context servletContext = webAppContext.getServletContext();
servletContext.setExtendedListenerTypes(true);
// servletContext.setExtendedListenerTypes(true);
initializer.onStartup(servletContext);
} catch (ServletException e) {
throw new RuntimeException(e);
}
}
});
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-web
AnnotationAwareOrderComparator.sort(initializers);
for (WebApplicationInitializer initializer : initializers) {
initializer.onStartup(servletContext);
代码示例来源:origin: apache/servicemix-bundles
AnnotationAwareOrderComparator.sort(initializers);
for (WebApplicationInitializer initializer : initializers) {
initializer.onStartup(servletContext);
内容来源于网络,如有侵权,请联系作者删除!