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

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

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

ApplicationContext.getApplicationScope介绍

[英]Returns a mutable Map that maps application scope attribute names to their values.
[中]返回将应用程序范围属性名称映射到其值的可变映射。

代码示例

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

/**
 * Returns the application scope.
 *
 * @return The application scope.
 */
public Map<String, Object> getApplicationScope() {
  return applicationContext.getApplicationScope();
}

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

/** {@inheritDoc} */
public Map<String, Object> getApplicationScope() {
  return context.getApplicationScope();
}

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

/**
 * Registers an application context. It will be registered into itself as an
 * attribute, using the {@link #APPLICATION_CONTEXT_ATTRIBUTE} name.
 *
 * @param applicationContext The application context to register.
 */
public static void register(ApplicationContext applicationContext) {
  applicationContext.getApplicationScope().put(
      APPLICATION_CONTEXT_ATTRIBUTE, applicationContext);
}

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

/**
 * Returns the container to be used in the application registered under a specific key.
 *
 * @param context The Tiles application context object to use.
 * @param key The key under which the container will be stored.
 * @return The container object.
 * @since 3.0.0
 */
public static TilesContainer getContainer(ApplicationContext context,
    String key) {
  if (key == null) {
    key = CONTAINER_ATTRIBUTE;
  }
  return (TilesContainer) context.getApplicationScope().get(key);
}

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

/**
 * Configures the container to be used in the application.
 *
 * @param context The Tiles application context object to use.
 * @param container The container object to set.
 * @param key The key under which the container will be stored.
 * @since 2.1.2
 */
public static void setContainer(ApplicationContext context,
    TilesContainer container, String key) {
  Logger log = LoggerFactory.getLogger(TilesAccess.class);
  if (key == null) {
    key = CONTAINER_ATTRIBUTE;
  }
  if (container == null) {
    if (log.isInfoEnabled()) {
      log.info("Removing TilesContext for context: " + context.getClass().getName());
    }
    context.getApplicationScope().remove(key);
  } else {
    if (log.isInfoEnabled()) {
      log.info("Publishing TilesContext for context: " + context.getClass().getName());
    }
    context.getApplicationScope().put(key, container);
  }
}

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

/** {@inheritDoc} */
@Override
protected DefinitionDAO<Locale> createLocaleDefinitionDao(ApplicationContext applicationContext,
    LocaleResolver resolver) {
  LocaleDbDefinitionDAO definitionDao = new LocaleDbDefinitionDAO();
  definitionDao.setDataSource((DataSource) applicationContext
      .getApplicationScope().get("dataSource"));
  return definitionDao;
}

相关文章