Search in sources :

Example 1 with ELParseException

use of javax.servlet.jsp.el.ELParseException in project tomcat by apache.

the class ExpressionEvaluatorImpl method parseExpression.

@Override
public Expression parseExpression(String expression, @SuppressWarnings("rawtypes") Class expectedType, FunctionMapper fMapper) throws ELException {
    try {
        ELContextImpl ctx = new ELContextImpl(ELContextImpl.getDefaultResolver(factory));
        if (fMapper != null) {
            ctx.setFunctionMapper(new FunctionMapperImpl(fMapper));
        }
        ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
        return new ExpressionImpl(ve, factory);
    } catch (javax.el.ELException e) {
        throw new ELParseException(e.getMessage());
    }
}
Also used : ValueExpression(javax.el.ValueExpression) ELParseException(javax.servlet.jsp.el.ELParseException)

Example 2 with ELParseException

use of javax.servlet.jsp.el.ELParseException in project sling by apache.

the class ExpressionEvaluatorImpl method parseExpression.

public Expression parseExpression(String expression, Class expectedType, FunctionMapper fMapper) throws ELException {
    try {
        ELContextImpl ctx = new ELContextImpl(ELResolverImpl.DefaultResolver);
        if (fMapper != null) {
            ctx.setFunctionMapper(new FunctionMapperImpl(fMapper));
        }
        ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
        return new ExpressionImpl(ve);
    } catch (javax.el.ELException e) {
        throw new ELParseException(e.getMessage());
    }
}
Also used : ValueExpression(javax.el.ValueExpression) ELParseException(javax.servlet.jsp.el.ELParseException)

Aggregations

ValueExpression (javax.el.ValueExpression)2 ELParseException (javax.servlet.jsp.el.ELParseException)2