当前位置: 首页>>代码示例>>Java>>正文


Java Dynamic.setAsyncSupported方法代码示例

本文整理汇总了Java中javax.servlet.ServletRegistration.Dynamic.setAsyncSupported方法的典型用法代码示例。如果您正苦于以下问题:Java Dynamic.setAsyncSupported方法的具体用法?Java Dynamic.setAsyncSupported怎么用?Java Dynamic.setAsyncSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.ServletRegistration.Dynamic的用法示例。


在下文中一共展示了Dynamic.setAsyncSupported方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: inject

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
public Dynamic inject(ServletContext servletContext, String urlPattern) {
  String[] urlPatterns = splitUrlPattern(urlPattern);
  if (urlPatterns.length == 0) {
    LOGGER.warn("urlPattern is empty, ignore register {}.", SERVLET_NAME);
    return null;
  }

  String listenAddress = ServletConfig.getLocalServerAddress();
  if (!ServletUtils.canPublishEndpoint(listenAddress)) {
    LOGGER.warn("ignore register {}.", SERVLET_NAME);
    return null;
  }

  // dynamic deploy a servlet to handle serviceComb RESTful request
  Dynamic dynamic = servletContext.addServlet(SERVLET_NAME, RestServlet.class);
  dynamic.setAsyncSupported(true);
  dynamic.addMapping(urlPatterns);
  dynamic.setLoadOnStartup(0);
  LOGGER.info("RESTful servlet url pattern: {}.", Arrays.toString(urlPatterns));

  return dynamic;
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:23,代码来源:RestServletInjector.java

示例2: initGitServlet

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
private void initGitServlet(Path gitWorkspace, ServletContext servletContext) throws IOException {
    if (!Files.exists(gitWorkspace)) {
        Files.createDirectories(gitWorkspace);
    }

    // add git servlet mapping
    Dynamic gitServlet = servletContext.addServlet("git-servlet", new GitServlet());
    gitServlet.addMapping("/git/*");
    gitServlet.setInitParameter("base-path", gitWorkspace.toString());
    gitServlet.setInitParameter("export-all", "true");
    gitServlet.setAsyncSupported(true);
    gitServlet.setLoadOnStartup(1);
}
 
开发者ID:FlowCI,项目名称:flow-platform,代码行数:14,代码来源:AppInit.java

示例3: onStartup

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@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);//①
}
 
开发者ID:longjiazuo,项目名称:springMvc4.x-project,代码行数:13,代码来源:WebInitializer.java

示例4: onStartup

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
	AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
	context.register(MyMvcConfig.class);
	context.setServletContext(servletContext);
	Dynamic servlet = servletContext.addServlet("dispatcher", new DispatcherServlet(context));
	servlet.addMapping("/");
	servlet.setLoadOnStartup(1);
	// 开启异步支持
	servlet.setAsyncSupported(true);
}
 
开发者ID:zhazhapan,项目名称:hello-spring,代码行数:12,代码来源:WebInitializer.java

示例5: onStartup

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
public void onStartup(ServletContext servletContext) throws ServletException {

    AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
    context.setConfigLocation("org.synchronoss.cloud.nio.multipart.example.config");
    context.setServletContext(servletContext);
    Dynamic dynamic = servletContext.addServlet("dispatcher", new DispatcherServlet(context));
    dynamic.setAsyncSupported(true);
    dynamic.addMapping("/");
    dynamic.setLoadOnStartup(1);

}
 
开发者ID:synchronoss,项目名称:nio-multipart,代码行数:13,代码来源:WebAppInitializer.java

示例6: onStartup

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
public void onStartup(ServletContext servletContext) throws ServletException {
	AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
	ctx.register(SpringConfig.class, JndiConfig.class, SwaggerConfig.class);

	Dynamic servlet = servletContext.addServlet("springDispatcher", new DispatcherServlet(ctx));
	servlet.addMapping("/");
	servlet.setAsyncSupported(true);
	servlet.setLoadOnStartup(1);
}
 
开发者ID:NWQMC,项目名称:WQP-WQX-Services,代码行数:10,代码来源:SpringInitializer.java

示例7: customizeRegistration

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
protected void customizeRegistration(Dynamic registration) {

	MultipartConfigElement multipartConfigElement = new MultipartConfigElement("");

	registration.setMultipartConfig(multipartConfigElement);
	registration.setInitParameter("dispatchOptionsRequest", "true");
	registration.setAsyncSupported(true);
}
 
开发者ID:digitalfondue,项目名称:lavagna,代码行数:10,代码来源:DispatcherServletInitializer.java

示例8: onStartup

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
public void onStartup(ServletContext sc) throws ServletException {
    AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
    ctx.scan("com.bitran");
    sc.addListener(new ContextLoaderListener(ctx));
    Dynamic servlet = sc.addServlet("appServlet", new DispatcherServlet(ctx));
    servlet.setAsyncSupported(true);
    servlet.setLoadOnStartup(1);
    servlet.addMapping("*.action");
}
 
开发者ID:wwrrss,项目名称:bitran,代码行数:11,代码来源:Inicializador.java

示例9: customizeRegistration

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
protected void customizeRegistration(Dynamic registration) {
	registration.setInitParameter("dispatchOptionsRequest", "true");
	registration.setAsyncSupported(true);
}
 
开发者ID:wieden-kennedy,项目名称:composite-framework,代码行数:6,代码来源:Initializer.java

示例10: customizeRegistration

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
protected void customizeRegistration(Dynamic registration) {
    registration.setAsyncSupported(true);
}
 
开发者ID:cwoolner,项目名称:flex-poker,代码行数:5,代码来源:WebInitializer.java


注:本文中的javax.servlet.ServletRegistration.Dynamic.setAsyncSupported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。