javax.servlet.ServletRegistration.Dynamic#setLoadOnStartup ( )源码实例Demo

下面列出了javax.servlet.ServletRegistration.Dynamic#setLoadOnStartup ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: sakai   文件: WebAppConfiguration.java
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.setServletContext(servletContext);
    rootContext.register(ThymeleafConfig.class);

    servletContext.addListener(new SakaiContextLoaderListener(rootContext));

    servletContext.addFilter("sakai.request", RequestFilter.class)
            .addMappingForUrlPatterns(
                    EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE),
                    true,
                    "/*");

    Dynamic servlet = servletContext.addServlet("sakai.googledrive", new DispatcherServlet(rootContext));
    servlet.addMapping("/");
    servlet.setLoadOnStartup(1);
}
 
源代码2 项目: sakai   文件: WebAppConfiguration.java
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.setServletContext(servletContext);
    rootContext.register(ThymeleafConfig.class);

    servletContext.addListener(new ToolListener());
    servletContext.addListener(new SakaiContextLoaderListener(rootContext));

    servletContext.addFilter("sakai.request", RequestFilter.class)
            .addMappingForUrlPatterns(
                    EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE),
                    true,
                    "/*");

    Dynamic servlet = servletContext.addServlet("sakai.message.bundle.manager", new DispatcherServlet(rootContext));
    servlet.addMapping("/");
    servlet.setLoadOnStartup(1);
}
 
源代码3 项目: sakai   文件: WebAppConfiguration.java
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.setServletContext(servletContext);
    rootContext.register(ThymeleafConfig.class);

    servletContext.addListener(new ToolListener());
    servletContext.addListener(new SakaiContextLoaderListener(rootContext));
    
    FilterRegistration requestFilterRegistration = servletContext.addFilter("sakai.request", RequestFilter.class);
    requestFilterRegistration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE), true, "/*");
    requestFilterRegistration.setInitParameter(RequestFilter.CONFIG_UPLOAD_ENABLED, "true");       

    Dynamic servlet = servletContext.addServlet("sakai-site-group-manager", new DispatcherServlet(rootContext));
    servlet.addMapping("/");
    servlet.setLoadOnStartup(1);
}
 
源代码4 项目: ldp4j   文件: BootstrapContextListener.java
private static void registerCXFServlet(ServletContext servletContext) {
	LOGGER.info("Registering CXF servlet...");
	Dynamic dynamic =
		servletContext.
			addServlet(
				"LDP4jFrontendServerServlet",
				"org.apache.cxf.transport.servlet.CXFServlet");
	dynamic.addMapping("/*");
	/** See https://issues.apache.org/jira/browse/CXF-5068 */
	dynamic.setInitParameter("disable-address-updates","true");
	/** Required for testing */
	dynamic.setInitParameter("static-welcome-file","/index.html");
	dynamic.setInitParameter("static-resources-list","/index.html");
	dynamic.setLoadOnStartup(1);
	LOGGER.info("CXF servlet registered.");
}
 
源代码5 项目: sakai   文件: WebAppConfiguration.java
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.setServletContext(servletContext);
    rootContext.register(ThymeleafConfig.class);

    servletContext.addListener(new ToolListener());
    servletContext.addListener(new SakaiContextLoaderListener(rootContext));
    
    FilterRegistration requestFilterRegistration = servletContext.addFilter("sakai.request", RequestFilter.class);
    requestFilterRegistration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE), true, "/*");
    requestFilterRegistration.setInitParameter(RequestFilter.CONFIG_UPLOAD_ENABLED, "true");       

    Dynamic servlet = servletContext.addServlet("sakai-site-group-manager", new DispatcherServlet(rootContext));
    servlet.addMapping("/");
    servlet.setLoadOnStartup(1);
}
 
源代码6 项目: sakai   文件: WebAppConfiguration.java
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.setServletContext(servletContext);
    rootContext.register(ThymeleafConfig.class);

    servletContext.addListener(new ToolListener());
    servletContext.addListener(new SakaiContextLoaderListener(rootContext));

    servletContext.addFilter("sakai.request", RequestFilter.class)
            .addMappingForUrlPatterns(
                    EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE),
                    true,
                    "/*");

    Dynamic servlet = servletContext.addServlet("sakai.message.bundle.manager", new DispatcherServlet(rootContext));
    servlet.addMapping("/");
    servlet.setLoadOnStartup(1);
}
 
源代码7 项目: sakai   文件: WebAppConfiguration.java
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.setServletContext(servletContext);
    rootContext.register(ThymeleafConfig.class);

    servletContext.addListener(new SakaiContextLoaderListener(rootContext));

    servletContext.addFilter("sakai.request", RequestFilter.class)
            .addMappingForUrlPatterns(
                    EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE),
                    true,
                    "/*");

    Dynamic servlet = servletContext.addServlet("sakai.onedrive", new DispatcherServlet(rootContext));
    servlet.addMapping("/");
    servlet.setLoadOnStartup(1);
}
 
源代码8 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // ③
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码9 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码10 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码11 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码12 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
	servlet.setAsyncSupported(true);//①
}
 
源代码13 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码14 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码15 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码16 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码17 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
}
 
源代码18 项目: springMvc4.x-project   文件: WebInitializer.java
@Override
public void onStartup(ServletContext servletContext)
		throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(MyMvcConfig.class);
	ctx.setServletContext(servletContext); // ②

	Dynamic servlet = servletContext.addServlet("dispatcher",new DispatcherServlet(ctx)); // 3
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
	servlet.setAsyncSupported(true);//①
}
 
源代码19 项目: audit4j-demo   文件: WebInitializer.java
public void onStartup(ServletContext servletContext) {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.setConfigLocation("org.audt4j.demo.hibernate.config");
	servletContext.addListener(new ContextLoaderListener(ctx));
	ctx.setServletContext(servletContext);
	Dynamic servlet = servletContext.addServlet("dispatcher",
			new DispatcherServlet(ctx));
	servlet.addMapping("/*");
	servlet.setLoadOnStartup(1);
	FilterRegistration.Dynamic springSecurityFilterChain = servletContext
			.addFilter("springSecurityFilterChain",
					new DelegatingFilterProxy());
	springSecurityFilterChain.addMappingForUrlPatterns(null, false, "/*");
	springSecurityFilterChain.setAsyncSupported(true);
}
 
源代码20 项目: spring4-sandbox   文件: AppInitializer.java
@Override
protected void customizeRegistration(Dynamic registration) {
	registration.setLoadOnStartup(2);
}