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

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

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

ApplicationContext.getContext介绍

[英]Returns the original, technology-dependent, context.
[中]返回依赖于技术的原始上下文。

代码示例

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

/** {@inheritDoc} */
public Object getContext() {
  return context.getContext();
}

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

/** {@inheritDoc} */
public void setApplicationContext(ApplicationContext applicationContext) {
  Object context = applicationContext.getContext();
  if (context instanceof ServletContext) {
    this.servletContext = (ServletContext) context;
  } else {
    throw new IllegalArgumentException(
        "The application context does not hold an instance of "
        + "ServletContext, consider using JuelExpressionFactoryFactory");
  }
}

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

/** {@inheritDoc} */
  @Override
  protected ApplicationContext createTilesApplicationContext(
      ApplicationContext preliminaryContext) {
    return new WildcardServletApplicationContext(
        (ServletContext) preliminaryContext.getContext());
  }
}

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

/** {@inheritDoc} */
@Override
protected ApplicationContext createTilesApplicationContext(
    ApplicationContext preliminaryContext) {
  return new WildcardServletApplicationContext(
      (ServletContext) preliminaryContext.getContext());
}

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

@Override
protected ApplicationContext createTilesApplicationContext(ApplicationContext preliminaryContext) {
  ServletContext servletContext = (ServletContext) preliminaryContext.getContext();
  if (servletContext.getInitParameter(DefinitionsFactory.DEFINITIONS_CONFIG) != null) {
    LOG.trace("Found definitions config in web.xml, using standard Servlet support ....");
    return new ServletApplicationContext(servletContext);
  } else {
    LOG.trace("Initializing Tiles wildcard support ...");
    return new StrutsWildcardServletApplicationContext(servletContext);
  }
}

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

private Map<String, String> getFreemarkerServletInitParameters(ApplicationContext applicationContext) {
  Object context = applicationContext.getContext();
  if (!(context instanceof ServletContext)) {
    return Maps.newHashMap();
  }
  ServletContext servletContext = (ServletContext) context;
  ServletRegistration servletRegistration = servletContext.getServletRegistration(freemarkerServletName);
  if (servletRegistration == null) {
    return Maps.newHashMap();
  }
  return servletRegistration.getInitParameters();
}

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

/** {@inheritDoc} */
public void initialize(ApplicationContext preliminaryContext) {
  ApplicationContext applicationContext = new WildcardServletApplicationContext(
      (ServletContext) preliminaryContext.getContext());
  loadInitializers(applicationContext);
  for (TilesInitializer initializer : initializers) {
    initializer.initialize(preliminaryContext);
  }
}

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

@Override
protected AttributeEvaluatorFactory createAttributeEvaluatorFactory(ApplicationContext applicationContext, LocaleResolver resolver) {
  AttributeEvaluator evaluator;
  if (tilesElPresent && JspFactory.getDefaultFactory() != null) {
    ServletContext context = (ServletContext) applicationContext.getContext();
    ELAttributeEvaluator elEvaluator = new ELAttributeEvaluator();
    elEvaluator.setExpressionFactory(JspFactory.getDefaultFactory().getJspApplicationContext(context).getExpressionFactory());
    CompositeELResolver compositeELResolver = new CompositeELResolver();
    compositeELResolver.add(new SimpleSpringBeanELResolver(beanFactory));
    elEvaluator.setResolver(compositeELResolver);
    evaluator = elEvaluator;
  } else {
    evaluator = new DirectAttributeEvaluator();
  }
  return new BasicAttributeEvaluatorFactory(evaluator);
}

相关文章