Package org.apache.tiles.el

Examples of org.apache.tiles.el.ELAttributeEvaluator


      try {
        // jsp-api-2.1 doesn't default instantiate a factory for us
        JspFactory factory = JspFactory.getDefaultFactory();
        if ((factory != null) && (factory.getJspApplicationContext(servletContext).getExpressionFactory() != null)) {
          logger.info("Found JSP 2.1 ExpressionFactory");
          ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
          evaluator.setExpressionFactory(factory.getJspApplicationContext(servletContext).getExpressionFactory());
          evaluator.setResolver(new CompositeELResolverImpl());
          return evaluator;
        }
      }
      catch (Throwable ex) {
        logger.warn("Could not obtain JSP 2.1 ExpressionFactory", ex);
View Full Code Here


     *
     * @param applicationContext The Tiles application context.
     * @return The EL evaluator.
     */
    private ELAttributeEvaluator createELEvaluator(ApplicationContext applicationContext) {
        ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
        JspExpressionFactoryFactory efFactory = new JspExpressionFactoryFactory();
        efFactory.setApplicationContext(applicationContext);
        evaluator.setExpressionFactory(efFactory.getExpressionFactory());
        ELResolver elResolver = new CompositeELResolver() {
            {
                BeanELResolver beanElResolver = new BeanELResolver(false);
                add(new ScopeELResolver());
                add(new TilesContextELResolver(beanElResolver));
                add(new TilesContextBeanELResolver());
                add(new ArrayELResolver(false));
                add(new ListELResolver(false));
                add(new MapELResolver(false));
                add(new ResourceBundleELResolver());
                add(beanElResolver);
            }
        };
        evaluator.setResolver(elResolver);
        return evaluator;
    }
View Full Code Here

    /** {@inheritDoc} */
    @SuppressWarnings("deprecation")
    protected void setUp() throws Exception {
        super.setUp();
        evaluator = new ELAttributeEvaluator();
        Map<String, Object> requestScope = new HashMap<String, Object>();
        Map<String, Object> sessionScope = new HashMap<String, Object>();
        Map<String, Object> applicationScope = new HashMap<String, Object>();
        requestScope.put("object1", "value");
        sessionScope.put("object2", new Integer(1));
View Full Code Here

     * @param applicationContext The Tiles application context.
     * @return The EL evaluator.
     */
    private ELAttributeEvaluator createELEvaluator(
            TilesApplicationContext applicationContext) {
        ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
        evaluator.setApplicationContext(applicationContext);
        JspExpressionFactoryFactory efFactory = new JspExpressionFactoryFactory();
        efFactory.setApplicationContext(applicationContext);
        evaluator.setExpressionFactory(efFactory.getExpressionFactory());
        ELResolver elResolver = new CompositeELResolver() {
            {
                add(new TilesContextELResolver());
                add(new TilesContextBeanELResolver());
                add(new ArrayELResolver(false));
                add(new ListELResolver(false));
                add(new MapELResolver(false));
                add(new ResourceBundleELResolver());
                add(new BeanELResolver(false));
            }
        };
        evaluator.setResolver(elResolver);
        return evaluator;
    }
View Full Code Here

     * @param applicationContext The Tiles application context.
     * @return The EL evaluator.
     */
    private ELAttributeEvaluator createELEvaluator(
            TilesApplicationContext applicationContext) {
        ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
        evaluator.setApplicationContext(applicationContext);
        JspExpressionFactoryFactory efFactory = new JspExpressionFactoryFactory();
        efFactory.setApplicationContext(applicationContext);
        evaluator.setExpressionFactory(efFactory.getExpressionFactory());
        ELResolver elResolver = new CompositeELResolver() {
            {
                add(new TilesContextELResolver());
                add(new TilesContextBeanELResolver());
                add(new ArrayELResolver(false));
                add(new ListELResolver(false));
                add(new MapELResolver(false));
                add(new ResourceBundleELResolver());
                add(new BeanELResolver(false));
            }
        };
        evaluator.setResolver(elResolver);
        return evaluator;
    }
View Full Code Here

      return new BasicAttributeEvaluatorFactory(createELEvaluator(context));
    }

    private AttributeEvaluator createELEvaluator(ApplicationContext context) {
      if (tilesElPresent) {
        ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
        if (new JspExpressionHelper().setExpressionFactory(evaluator)) {
          evaluator.setResolver(new CompositeELResolverImpl());
          return evaluator;
        }
      }
      return new DirectAttributeEvaluator();
    }
View Full Code Here


  private static class TilesElActivator {

    public static AttributeEvaluator createEvaluator(TilesApplicationContext applicationContext) {
      ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
      evaluator.setApplicationContext(applicationContext);
      evaluator.init(Collections.<String, String>emptyMap());
      return evaluator;
    }
View Full Code Here


  private class TilesElActivator {

    public AttributeEvaluator createEvaluator() {
      ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
      evaluator.setExpressionFactory(
          JspFactory.getDefaultFactory().getJspApplicationContext(servletContext).getExpressionFactory());
      evaluator.setResolver(new CompositeELResolverImpl());
      return evaluator;
    }
View Full Code Here

     *
     * @param applicationContext The Tiles application context.
     * @return The EL evaluator.
     */
    private ELAttributeEvaluator createELEvaluator(ApplicationContext applicationContext) {
        ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
        JspExpressionFactoryFactory efFactory = new JspExpressionFactoryFactory();
        efFactory.setApplicationContext(applicationContext);
        evaluator.setExpressionFactory(efFactory.getExpressionFactory());
        ELResolver elResolver = new CompositeELResolver() {
            {
                BeanELResolver beanElResolver = new BeanELResolver(false);
                add(new ScopeELResolver());
                add(new TilesContextELResolver(beanElResolver));
                add(new TilesContextBeanELResolver());
                add(new ArrayELResolver(false));
                add(new ListELResolver(false));
                add(new MapELResolver(false));
                add(new ResourceBundleELResolver());
                add(beanElResolver);
            }
        };
        evaluator.setResolver(elResolver);
        return evaluator;
    }
View Full Code Here

    }

    private static class TilesElActivator {

        public static AttributeEvaluator createEvaluator(TilesApplicationContext applicationContext) {
            ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
            evaluator.setApplicationContext(applicationContext);
            evaluator.init(Collections.<String, String>emptyMap());
            return evaluator;
        }
View Full Code Here

TOP

Related Classes of org.apache.tiles.el.ELAttributeEvaluator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.