Examples of ELContextImpl


Examples of org.apache.jasper.el.ELContextImpl

                retValue = AccessController
                        .doPrivileged(new PrivilegedExceptionAction<Object>() {

                            @Override
                            public Object run() throws Exception {
                                ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
                                ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
                                ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
                                return ve.getValue(ctx);
                            }
                        });
            } catch (PrivilegedActionException ex) {
                Exception realEx = ex.getException();
                if (realEx instanceof ELException) {
                    throw (ELException) realEx;
                } else {
                    throw new ELException(realEx);
                }
            }
        } else {
            ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
            ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
            ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
            retValue = ve.getValue(ctx);
        }
        if (escape && retValue != null) {
            retValue = XmlEscape(retValue.toString());
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

      try {
        retValue = AccessController
            .doPrivileged(new PrivilegedExceptionAction() {

              public Object run() throws Exception {
                                ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
                                ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
                ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
                                return ve.getValue(ctx);
              }
            });
      } catch (PrivilegedActionException ex) {
        Exception realEx = ex.getException();
        if (realEx instanceof ELException) {
          throw (ELException) realEx;
        } else {
          throw new ELException(realEx);
        }
      }
    } else {
            ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
            ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
            ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
            retValue = ve.getValue(ctx);
    }
    return retValue;
  }
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

                                        validateFunctions(el, n);
                                        jspAttrs[i] = new Node.JspAttribute(tldAttr,
                                                attrs.getQName(i), attrs.getURI(i),
                                                attrs.getLocalName(i),
                                                attrs.getValue(i), false, el, false);
                                        ELContextImpl ctx = new ELContextImpl(expressionFactory);
                                        ctx.setFunctionMapper(getFunctionMapper(el));
                                        try {
                                            jspAttrs[i].validateEL(this.pageInfo.getExpressionFactory(), ctx);
                                        } catch (ELException e) {
                                            err.jspError(n.getStart(),
                                                    MESSAGES.invalidExpression(attrs.getValue(i)), e);
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

                        } else {
                            result = new Node.JspAttribute(tai, qName, uri,
                                    localName, value, false, el, dynamic);
                        }

                        ELContextImpl ctx = new ELContextImpl(expressionFactory);
                        ctx.setFunctionMapper(getFunctionMapper(el));

                        try {
                            result.validateEL(this.pageInfo
                                    .getExpressionFactory(), ctx);
                        } catch (ELException e) {
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

        private void prepareExpression(ELNode.Nodes el, Node n, String expr)
                throws JasperException {
            validateFunctions(el, n);

            // test it out
            ELContextImpl ctx = new ELContextImpl(expressionFactory);
            ctx.setFunctionMapper(this.getFunctionMapper(el));
            ExpressionFactory ef = this.pageInfo.getExpressionFactory();
            try {
                ef.createValueExpression(ctx, expr, Object.class);
            } catch (ELException e) {
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

    private ELContext context;
   
    @Override
    public void setUp() {
        factory = ExpressionFactory.newInstance();
        context = new ELContextImpl();

        TesterBeanA beanA = new TesterBeanA();
        beanA.setName("A");
        context.getVariableMapper().setVariable("beanA",
                factory.createValueExpression(beanA, TesterBeanA.class));
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

    /**
     * Tests that a valid property is resolved.
     */
    public void testGetType03() {
        ArrayELResolver resolver = new ArrayELResolver();
        ELContext context = new ELContextImpl();

        String[] base = new String[] { "element" };
        Class<?> result = resolver.getType(context, base, new Integer(0));

        Assert.assertEquals(base.getClass().getComponentType(), result);
        Assert.assertTrue(context.isPropertyResolved());
    }
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

     */
    public void testGetType04() {
        Exception expected = null;
        try {
            ArrayELResolver resolver = new ArrayELResolver();
            ELContext context = new ELContextImpl();

            String[] base = new String[] { "element" };
            resolver.getType(context, base, new Integer(1));
        } catch (Exception e) {
            expected = e;
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

    /**
     * Tests that a valid property is resolved.
     */
    public void testGetValue03() {
        ArrayELResolver resolver = new ArrayELResolver();
        ELContext context = new ELContextImpl();

        String[] base = new String[] { "element" };
        Object result = resolver.getValue(context, base, new Integer(0));

        Assert.assertEquals("element", result);
        Assert.assertTrue(context.isPropertyResolved());
    }
View Full Code Here

Examples of org.apache.jasper.el.ELContextImpl

     */
    public void testGetValue04() {
        Exception expected = null;
        try {
            ArrayELResolver resolver = new ArrayELResolver();
            ELContext context = new ELContextImpl();

            String[] base = new String[] { "element" };
            resolver.getValue(context, base, "key");
        } catch (Exception e) {
            expected = e;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.