/** * Evaluate an EL expression. <p> * * @param <T> the return type of the expression * @param expr EL expression to evaluate. * @param clazz return type of the EL expression. * @return the object the EL expression evaluated to. * @throws Exception thrown if an EL function failed due to a transient error or EL expression could not be * evaluated. */ @SuppressWarnings({"unchecked", "deprecation"}) public <T> T evaluate(String expr, Class<T> clazz) throws Exception { ELEvaluator existing = current.get(); try { current.set(this); return (T) evaluator.evaluate(expr, clazz, context, context); } catch (ELException ex) { if (ex.getRootCause() instanceof Exception) { throw (Exception) ex.getRootCause(); } else { throw ex; } } finally { current.set(existing); } }
/** * Evaluate an EL expression. <p> * * @param <T> the return type of the expression * @param expr EL expression to evaluate. * @param clazz return type of the EL expression. * @return the object the EL expression evaluated to. * @throws Exception thrown if an EL function failed due to a transient error or EL expression could not be * evaluated. */ @SuppressWarnings({"unchecked", "deprecation"}) public <T> T evaluate(String expr, Class<T> clazz) throws Exception { ELEvaluator existing = current.get(); try { current.set(this); return (T) evaluator.evaluate(expr, clazz, context, context); } catch (ELException ex) { if (ex.getRootCause() instanceof Exception) { throw (Exception) ex.getRootCause(); } else { throw ex; } } finally { current.set(existing); } }
if (ex.getRootCause() instanceof Exception) { throw (Exception) ex.getRootCause();
if (ex.getRootCause() instanceof Exception) { throw (Exception) ex.getRootCause();
rootCause = ((JspException) t).getRootCause(); } else if (t instanceof ELException) { rootCause = ((ELException) t).getRootCause();
rootCause = ((JspException) t).getRootCause(); } else if (t instanceof ELException) { rootCause = ((ELException) t).getRootCause();