org.apache.tiles.request.ApplicationContext.getResources()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中org.apache.tiles.request.ApplicationContext.getResources()方法的一些代码示例,展示了ApplicationContext.getResources()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationContext.getResources()方法的具体详情如下:
包路径:org.apache.tiles.request.ApplicationContext
类名称:ApplicationContext
方法名:getResources

ApplicationContext.getResources介绍

[英]Return the application resources mapped to the specified path.
[中]返回映射到指定路径的应用程序资源。

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Override
protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
  if (definitions != null) {
    List<ApplicationResource> result = new LinkedList<>();
    for (String definition : definitions) {
      Collection<ApplicationResource> resources = applicationContext.getResources(definition);
      if (resources != null) {
        result.addAll(resources);
      }
    }
    return result;
  }
  else {
    return super.getSources(applicationContext);
  }
}

代码示例来源:origin: org.springframework/spring-webmvc

@Override
protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
  if (definitions != null) {
    List<ApplicationResource> result = new LinkedList<>();
    for (String definition : definitions) {
      Collection<ApplicationResource> resources = applicationContext.getResources(definition);
      if (resources != null) {
        result.addAll(resources);
      }
    }
    return result;
  }
  else {
    return super.getSources(applicationContext);
  }
}

代码示例来源:origin: org.apache.tiles/tiles-request-api

/** {@inheritDoc} */
  public Collection<ApplicationResource> getResources(String path) {
    return context.getResources(path);
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-ui-commons

@Override
protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
  if (definitions != null) {
    List<ApplicationResource> result = new LinkedList<ApplicationResource>();
    for (String definition : definitions) {
      result.addAll(applicationContext.getResources(definition));
    }
    return result;
  } else {
    return super.getSources(applicationContext);
  }
}

代码示例来源:origin: spring-projects/spring-framework-issues

@Override
protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
  if (definitions != null) {
    List<ApplicationResource> result = new LinkedList<ApplicationResource>();
    for (String definition : definitions) {
      result.addAll(applicationContext.getResources(definition));
    }
    return result;
  }
  else {
    return super.getSources(applicationContext);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
  if (definitions != null) {
    List<ApplicationResource> result = new LinkedList<ApplicationResource>();
    for (String definition : definitions) {
      Collection<ApplicationResource> resources = applicationContext.getResources(definition);
      if (resources != null) {
        result.addAll(resources);
      }
    }
    return result;
  }
  else {
    return super.getSources(applicationContext);
  }
}

代码示例来源:origin: org.apache.tiles/tiles-extras

/** {@inheritDoc} */
@Override
protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
  Collection<ApplicationResource> webINFSet = applicationContext.getResources("/WEB-INF/**/tiles*.xml");
  Collection<ApplicationResource> metaINFSet = applicationContext
      .getResources("classpath*:META-INF/**/tiles*.xml");
  List<ApplicationResource> filteredResources = new ArrayList<ApplicationResource>();
  if (webINFSet != null) {
    for (ApplicationResource resource : webINFSet) {
      if (Locale.ROOT.equals(resource.getLocale())) {
        filteredResources.add(resource);
      }
    }
  }
  if (metaINFSet != null) {
    for (ApplicationResource resource : metaINFSet) {
      if (Locale.ROOT.equals(resource.getLocale())) {
        filteredResources.add(resource);
      }
    }
  }
  return filteredResources;
}

代码示例来源:origin: org.apache.tiles/tiles-test-common

/** {@inheritDoc} */
  @Override
  protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
    List<ApplicationResource> urls = new ArrayList<ApplicationResource>();
    urls.addAll(applicationContext
        .getResources("/WEB-INF/**/tiles-defs*.xml"));
    urls.add(applicationContext.getResource(
        "classpath:/org/apache/tiles/classpath-defs.xml"));
    urls.add(applicationContext.getResource(
        "classpath:/org/apache/tiles/freemarker-classpath-defs.xml"));
    urls.add(applicationContext.getResource(
      "classpath:/org/apache/tiles/velocity-classpath-defs.xml"));
    return urls;
  }
}

代码示例来源:origin: org.apache.struts/struts2-tiles-plugin

@Override
protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
  Collection<ApplicationResource> resources = new ArrayList<>();
  Set<String> definitions = getTilesDefinitions(applicationContext.getInitParams());
  for (String definition : definitions) {
    resources.addAll(applicationContext.getResources(definition));
  }
  if (resources.contains(null)) {
    LOG.warn("Some resources were not found. Definitions: {}. Found resources: {}", definitions, resources);
  }
  List<ApplicationResource> filteredResources = new ArrayList<>();
  for (ApplicationResource resource : resources) {
    if (resource != null && Locale.ROOT.equals(resource.getLocale())) {
      filteredResources.add(resource);
    }
  }
  return filteredResources;
}

代码示例来源:origin: org.apache.tiles/tiles-extras

try {
  Collection<ApplicationResource> resources = applicationContext
      .getResources("classpath*:META-INF/MANIFEST.MF");
  ApplicationResource mainResource = applicationContext.getResource("/META-INF/MANIFEST.MF");
  if (mainResource != null) {

相关文章