Search in sources :

Example 21 with ELException

use of javax.el.ELException in project camunda-engine-dmn by camunda.

the class FeelEngineFactoryImpl method createExpressionFactory.

protected ExpressionFactory createExpressionFactory() {
    Properties properties = new Properties();
    properties.put(ExpressionFactoryImpl.PROP_CACHE_SIZE, String.valueOf(expressionCacheSize));
    try {
        return new ExpressionFactoryImpl(properties, createTypeConverter());
    } catch (ELException e) {
        throw LOG.unableToInitializeFeelEngine(e);
    }
}
Also used : ExpressionFactoryImpl(de.odysseus.el.ExpressionFactoryImpl) ELException(javax.el.ELException) Properties(java.util.Properties)

Example 22 with ELException

use of javax.el.ELException in project muikku by otavanopisto.

the class ExceptionHandler method handle.

@Override
public void handle() throws FacesException {
    for (final Iterator<ExceptionQueuedEvent> queuedEventIterator = getUnhandledExceptionQueuedEvents().iterator(); queuedEventIterator.hasNext(); ) {
        ExceptionQueuedEvent queuedEvent = queuedEventIterator.next();
        ExceptionQueuedEventContext queuedEventContext = queuedEvent.getContext();
        Throwable exception = queuedEventContext.getException();
        while ((exception instanceof FacesException || exception instanceof EJBException || exception instanceof ELException || exception instanceof RewriteException || exception instanceof CreationException || exception instanceof IllegalStateException) && exception.getCause() != null) {
            exception = exception.getCause();
        }
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext externalContext = facesContext.getExternalContext();
        try {
            if (exception instanceof AuthorizationException) {
                externalContext.setResponseStatus(HttpServletResponse.SC_FORBIDDEN);
                renderView("/error/access-denied.jsf");
            } else if (exception instanceof FileNotFoundException) {
                externalContext.setResponseStatus(HttpServletResponse.SC_NOT_FOUND);
                renderView("/error/not-found.jsf");
            } else {
                throw new FacesException(exception);
            }
        } finally {
            queuedEventIterator.remove();
        }
    }
    getWrapped().handle();
}
Also used : ExceptionQueuedEvent(javax.faces.event.ExceptionQueuedEvent) FacesContext(javax.faces.context.FacesContext) AuthorizationException(fi.otavanopisto.security.AuthorizationException) FileNotFoundException(java.io.FileNotFoundException) CreationException(javax.enterprise.inject.CreationException) FacesException(javax.faces.FacesException) ExceptionQueuedEventContext(javax.faces.event.ExceptionQueuedEventContext) RewriteException(org.ocpsoft.rewrite.exception.RewriteException) ExternalContext(javax.faces.context.ExternalContext) ELException(javax.el.ELException) EJBException(javax.ejb.EJBException)

Example 23 with ELException

use of javax.el.ELException in project Activiti by Activiti.

the class DynamicBeanPropertyELResolver method setValue.

@Override
public void setValue(ELContext context, Object base, Object property, Object value) {
    if (base == null || this.getCommonPropertyType(context, base) == null) {
        return;
    }
    String propertyName = property.toString();
    try {
        ReflectUtil.invoke(base, this.writeMethodName, new Object[] { propertyName, value });
        context.setPropertyResolved(true);
    } catch (Exception e) {
        throw new ELException(e);
    }
}
Also used : ELException(javax.el.ELException) ELException(javax.el.ELException)

Aggregations

ELException (javax.el.ELException)23 ValueExpression (javax.el.ValueExpression)6 Method (java.lang.reflect.Method)5 ELContext (javax.el.ELContext)4 Test (org.junit.Test)4 ExpressionFactory (javax.el.ExpressionFactory)3 ELContextImpl (org.apache.jasper.el.ELContextImpl)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 FunctionMapper (javax.el.FunctionMapper)2 ExpressionBuilder (org.jboss.el.lang.ExpressionBuilder)2 BeansException (org.springframework.beans.BeansException)2 WebApplicationContext (org.springframework.web.context.WebApplicationContext)2 ExpressionFactoryImpl (de.odysseus.el.ExpressionFactoryImpl)1 AuthorizationException (fi.otavanopisto.security.AuthorizationException)1 FileNotFoundException (java.io.FileNotFoundException)1 StringReader (java.io.StringReader)1 BigDecimal (java.math.BigDecimal)1 BigInteger (java.math.BigInteger)1 Properties (java.util.Properties)1 EJBException (javax.ejb.EJBException)1