本文整理匯總了Java中org.springframework.web.context.support.AnnotationConfigWebApplicationContext.setDisplayName方法的典型用法代碼示例。如果您正苦於以下問題:Java AnnotationConfigWebApplicationContext.setDisplayName方法的具體用法?Java AnnotationConfigWebApplicationContext.setDisplayName怎麽用?Java AnnotationConfigWebApplicationContext.setDisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.web.context.support.AnnotationConfigWebApplicationContext
的用法示例。
在下文中一共展示了AnnotationConfigWebApplicationContext.setDisplayName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onStartup
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; //導入方法依賴的package包/類
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
//On charge le contexte de l'app
AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
rootContext.setDisplayName("scrumtracker");
rootContext.register(ApplicationContext.class);
//Context loader listener
servletContext.addListener(new ContextLoaderListener(rootContext));
//Dispatcher servlet
ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(rootContext));
dispatcher.setLoadOnStartup(1);
dispatcher.addMapping("/");
}
示例2: createRootApplicationContext
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; //導入方法依賴的package包/類
@Override
protected WebApplicationContext createRootApplicationContext() {
AnnotationConfigWebApplicationContext applicationContext = (AnnotationConfigWebApplicationContext) super.createRootApplicationContext();
if (applicationContext != null)
applicationContext.setDisplayName("Root WebMvcApplicationConfig");
return applicationContext;
}
示例3: createServletApplicationContext
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; //導入方法依賴的package包/類
@Override
protected WebApplicationContext createServletApplicationContext() {
AnnotationConfigWebApplicationContext applicationContext = (AnnotationConfigWebApplicationContext) super.createServletApplicationContext();
if (applicationContext != null)
applicationContext.setDisplayName("DispatcherServlet WebMvcApplicationConfig");
return applicationContext;
}