Package javax.servlet.jsp.el

Examples of javax.servlet.jsp.el.ELException


            } catch (PrivilegedActionException ex) {
                Exception realEx = ex.getException();
                if (realEx instanceof ELException) {
                    throw (ELException) realEx;
                } else {
                    throw new ELException(realEx);
                }
            }
        } else {
            retValue = elExprEval.evaluate(expression,
                                           expectedType,
View Full Code Here


         * @return the variable value.
         * @throws ELException thrown if the variable is not defined in the context.
         */
        public Object resolveVariable(String name) throws ELException {
            if (!vars.containsKey(name)) {
                throw new ELException(XLog.format("variable [{0}] cannot be resolved", name));
            }
            return vars.get(name);
        }
View Full Code Here

    } else {
      ELDate date=ELDate.parse(name);
      if (date!=null) {
        return date;
      } else {
        throw new ELException("Cannot resolve variable: " + name);
      }
    }
  }
View Full Code Here

         * @return the variable value.
         * @throws ELException thrown if the variable is not defined in the context.
         */
        public Object resolveVariable(String name) throws ELException {
            if (!vars.containsKey(name)) {
                throw new ELException(XLog.format("variable [{0}] cannot be resolved", name));
            }
            return vars.get(name);
        }
View Full Code Here

            } catch (PrivilegedActionException ex) {
                Exception realEx = ex.getException();
    if (realEx instanceof ELException) {
        throw (ELException) realEx;
    } else {
        throw new ELException(realEx);
    }
            }
        } else {
      retValue = elExprEval.evaluate(expression,
             expectedType,
View Full Code Here

      } 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));
View Full Code Here

          if (log.isErrorEnabled()) {
              String message = _MessageUtil.getMessageWithArgs(
                  _Constants.TOSTRING_EXCEPTION,
                  pValue.getClass().getName());
              log.error(message, exc);
              throw new ELException(exc);
          }
          return "";   
      }
    }
  }
View Full Code Here

    else if (pValue instanceof Boolean) {
        if (log.isErrorEnabled()) {
            String message = _MessageUtil.getMessageWithArgs(
                _Constants.BOOLEAN_TO_NUMBER, pValue, pClass.getName());
            log.error(message);
            throw new ELException(message);
        }
        return coerceToPrimitiveNumber(ZERO, pClass);    
    }
    else if (pValue.getClass () == pClass) {
      return (Number) pValue;
    }
    else if (pValue instanceof Number) {
      return coerceToPrimitiveNumber ((Number) pValue, pClass);
    }
    else if (pValue instanceof String) {
      try {
    return coerceToPrimitiveNumber ((String) pValue, pClass);
      }
      catch (Exception exc) {
          if (log.isErrorEnabled()) {
              String message = _MessageUtil.getMessageWithArgs(
                  _Constants.STRING_TO_NUMBER_EXCEPTION,
                  (String) pValue, pClass.getName());
              log.error(message);
              throw new ELException(message);
          }   
        return coerceToPrimitiveNumber (ZERO, pClass);
      }
    }
    else {
        if (log.isErrorEnabled()) {
            String message = _MessageUtil.getMessageWithArgs(
                _Constants.COERCE_TO_NUMBER,
                pValue.getClass().getName(),
                pClass.getName());
            log.error(message);
            throw new ELException(message);
        }     
      return coerceToPrimitiveNumber (0, pClass);
    }
  }
View Full Code Here

    else if (pValue instanceof Boolean) {
        if (log.isErrorEnabled()) {
            String message = _MessageUtil.getMessageWithArgs(
                _Constants.BOOLEAN_TO_CHARACTER, pValue);
            log.error(message);
            throw new ELException(message);
        }    
      return _PrimitiveObjects.getCharacter ((char) 0);
    }
    else if (pValue instanceof Number) {
      return _PrimitiveObjects.getCharacter
    ((char) ((Number) pValue).shortValue ());
    }
    else if (pValue instanceof String) {
      String str = (String) pValue;
      return _PrimitiveObjects.getCharacter (str.charAt (0));
    }
    else {
        if (log.isErrorEnabled()) {
            String message = _MessageUtil.getMessageWithArgs(
                _Constants.COERCE_TO_CHARACTER,
                pValue.getClass().getName());
            log.error(message);
            throw new ELException(message);
        }    
      return _PrimitiveObjects.getCharacter ((char) 0);
    }
  }
View Full Code Here

      catch (Exception exc) {
          if (log.isErrorEnabled()) {
              String message = _MessageUtil.getMessageWithArgs(
                  _Constants.STRING_TO_BOOLEAN, (String) pValue);
              log.error(message, exc);
              throw new ELException(message, exc);
          }   
    return Boolean.FALSE;
      }
    }
    else {
        if (log.isErrorEnabled()) {
            String message = _MessageUtil.getMessageWithArgs(
                _Constants.COERCE_TO_BOOLEAN,
                pValue.getClass().getName());
            log.error(message);
            throw new ELException(message);
        }    
      return Boolean.TRUE;
    }
  }
View Full Code Here

TOP

Related Classes of javax.servlet.jsp.el.ELException

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.