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

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

本文整理了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

  1. /** {@inheritDoc} */
  2. public ApplicationContext getNestedObject(Request obj) {
  3. return obj.getApplicationContext();
  4. }
  5. }

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

  1. /** {@inheritDoc} */
  2. public ApplicationContext getApplicationContext() {
  3. return context.getApplicationContext();
  4. }

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

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

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

  1. /** {@inheritDoc} */
  2. public Object evaluate(String expression, Request request) {
  3. ELContextImpl context = new ELContextImpl(resolver);
  4. context.putContext(Request.class, request);
  5. context.putContext(ApplicationContext.class,
  6. request.getApplicationContext());
  7. ValueExpression valueExpression = expressionFactory
  8. .createValueExpression(context, expression, Object.class);
  9. return valueExpression.getValue(context);
  10. }
  11. }

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

  1. /**
  2. * Returns the current container that has been set, or the default one.
  3. *
  4. * @param request The request to use.
  5. * @return The current Tiles container to use in web pages.
  6. * @since 2.1.0
  7. */
  8. public static TilesContainer getCurrentContainer(Request request) {
  9. ApplicationContext context = request.getApplicationContext();
  10. Map<String, Object> requestScope = request.getContext("request");
  11. TilesContainer container = (TilesContainer) requestScope.get(CURRENT_CONTAINER_ATTRIBUTE_NAME);
  12. if (container == null) {
  13. container = getContainer(context);
  14. requestScope.put(CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
  15. }
  16. return container;
  17. }
  18. }

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

  1. /**
  2. * Sets the current container to use in web pages.
  3. *
  4. * @param request The request to use.
  5. * @param key The key under which the container is stored.
  6. * @since 2.1.0
  7. */
  8. public static void setCurrentContainer(Request request,
  9. String key) {
  10. ApplicationContext applicationContext = request.getApplicationContext();
  11. TilesContainer container = getContainer(applicationContext, key);
  12. if (container != null) {
  13. request.getContext("request").put(CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
  14. } else {
  15. throw new NoSuchContainerException("The container with the key '"
  16. + key + "' cannot be found");
  17. }
  18. }

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

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

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

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

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

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

相关文章