當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。