/** {@inheritDoc} */ public Object getContext() { return context.getContext(); }
/** {@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"); } }
/** {@inheritDoc} */ @Override protected ApplicationContext createTilesApplicationContext( ApplicationContext preliminaryContext) { return new WildcardServletApplicationContext( (ServletContext) preliminaryContext.getContext()); } }
/** {@inheritDoc} */ @Override protected ApplicationContext createTilesApplicationContext( ApplicationContext preliminaryContext) { return new WildcardServletApplicationContext( (ServletContext) preliminaryContext.getContext()); }
@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); } }
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(); }
/** {@inheritDoc} */ public void initialize(ApplicationContext preliminaryContext) { ApplicationContext applicationContext = new WildcardServletApplicationContext( (ServletContext) preliminaryContext.getContext()); loadInitializers(applicationContext); for (TilesInitializer initializer : initializers) { initializer.initialize(preliminaryContext); } }
@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); }