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

x33g5p2x  于2022-01-29 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(460)

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

Request.getApplicationContext介绍

[英]Returns the associated application context.
[中]返回关联的应用程序上下文。

代码示例

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

/** {@inheritDoc} */
  public ApplicationContext getNestedObject(Request obj) {
    return obj.getApplicationContext();
  }
}

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

/** {@inheritDoc} */
public ApplicationContext getApplicationContext() {
  return context.getApplicationContext();
}

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

ApplicationContext tilesAppContext = tilesRequest.getApplicationContext();
BasicTilesContainer container = (BasicTilesContainer) TilesAccess.getContainer(tilesAppContext);

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

/** {@inheritDoc} */
  public Object evaluate(String expression, Request request) {
    ELContextImpl context = new ELContextImpl(resolver);
    context.putContext(Request.class, request);
    context.putContext(ApplicationContext.class,
        request.getApplicationContext());
    ValueExpression valueExpression = expressionFactory
        .createValueExpression(context, expression, Object.class);

    return valueExpression.getValue(context);
  }
}

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

/**
   * Returns the current container that has been set, or the default one.
   *
   * @param request The request to use.
   * @return The current Tiles container to use in web pages.
   * @since 2.1.0
   */
  public static TilesContainer getCurrentContainer(Request request) {
    ApplicationContext context = request.getApplicationContext();
    Map<String, Object> requestScope = request.getContext("request");
    TilesContainer container = (TilesContainer) requestScope.get(CURRENT_CONTAINER_ATTRIBUTE_NAME);
    if (container == null) {
      container = getContainer(context);
      requestScope.put(CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
    }

    return container;
  }
}

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

/**
 * Sets the current container to use in web pages.
 *
 * @param request The request to use.
 * @param key The key under which the container is stored.
 * @since 2.1.0
 */
public static void setCurrentContainer(Request request,
    String key) {
  ApplicationContext applicationContext = request.getApplicationContext();
  TilesContainer container = getContainer(applicationContext, key);
  if (container != null) {
    request.getContext("request").put(CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
  } else {
    throw new NoSuchContainerException("The container with the key '"
        + key + "' cannot be found");
  }
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

protected void fallbackModelRenderer(
      Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
    Request tilesRequest = super.createTilesRequest(request, response);
    ApplicationContext applicationContext = tilesRequest.getApplicationContext();
    TilesContainer container = TilesAccess.getContainer(applicationContext);
    if (container == null) {
      throw new ServletException("Tiles container is not initialized. " +
          "Have you added a TilesConfigurer to your web application context?");
    }
    exposeModelAsRequestAttributes(model, request);
    JstlUtils.exposeLocalizationContext(new RequestContext(request, getServletContext()));
    Definition definition = container.getDefinition(getUrl(), tilesRequest);
    container.render(definition, tilesRequest);
  }
}

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

ApplicationContext tilesAppContext = tilesRequest.getApplicationContext();
BasicTilesContainer container = (BasicTilesContainer) TilesAccess.getContainer(tilesAppContext);

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

ApplicationContext tilesAppContext = tilesRequest.getApplicationContext();
BasicTilesContainer container = (BasicTilesContainer) TilesAccess.getContainer(tilesAppContext);

相关文章