Package ognl

Examples of ognl.OgnlException


        return dst;
    }

    private void throwMBeanException(Throwable e) throws MBeanException {
        if (e instanceof OgnlException) {
            OgnlException ognle = (OgnlException) e;
            if (ognle.getReason() != null) {
                throwMBeanException(ognle.getReason());
            } else {
                String message = ognle.getMessage();
                if (e instanceof NoSuchPropertyException) {
                    message = "No such property: " + message;
                } else if (e instanceof ExpressionSyntaxException) {
                    message = "Illegal expression syntax: " + message;
                } else if (e instanceof InappropriateExpressionException) {
                    message = "Inappropriate expression: " + message;
                }
                e = new IllegalArgumentException(ognle.getMessage());
                e.setStackTrace(ognle.getStackTrace());
            }
        }
        if (e instanceof InvocationTargetException) {
            throwMBeanException(e.getCause());
        }
View Full Code Here


    }

    protected void setValue(String name, Map<String, Object> context, Object root, Object value, boolean evalName) throws OgnlException {
        Object tree = compile(name, context);
        if (!evalName && isEvalExpression(tree, context)) {
            throw new OgnlException("Eval expression cannot be used as parameter name");
        }
        Ognl.setValue(tree, context, root, value);
    }
View Full Code Here

        return tree;
    }
   
    private void checkEnableEvalExpression(Object tree, Map<String, Object> context) throws OgnlException {
        if (!enableEvalExpression && isEvalExpression(tree, context)) {
            throw new OgnlException("Eval expressions has been disabled!");
        }
    }
View Full Code Here

            if (result instanceof Boolean) {
                if (((Boolean) result).booleanValue()) {
                    answer.add(s);
                }
            } else {
                throw new OgnlException(
                        "Query didn't return a boolean value: " + query);
            }
        }
       
        return answer;
View Full Code Here

    @Override
    public final Object setPossibleProperty(Map context, Object target, String name,
            Object value) throws OgnlException {
        if (context.containsKey(READ_ONLY_MODE)) {
            throw new OgnlException("Expression must be read-only: " + context.get(QUERY));
        }
       
        Object answer = setProperty0((OgnlContext) context, target, name, value);
        if (answer == OgnlRuntime.NotFound) {
            answer = super.setPossibleProperty(context, target, name, value);
View Full Code Here

        return dst;
    }

    private void throwMBeanException(Throwable e) throws MBeanException {
        if (e instanceof OgnlException) {
            OgnlException ognle = (OgnlException) e;
            if (ognle.getReason() != null) {
                throwMBeanException(ognle.getReason());
            } else {
                String message = ognle.getMessage();
                if (e instanceof NoSuchPropertyException) {
                    message = "No such property: " + message;
                } else if (e instanceof ExpressionSyntaxException) {
                    message = "Illegal expression syntax: " + message;
                } else if (e instanceof InappropriateExpressionException) {
                    message = "Inappropriate expression: " + message;
                }
                e = new IllegalArgumentException(ognle.getMessage());
                e.setStackTrace(ognle.getStackTrace());
            }
        }
        if (e instanceof InvocationTargetException) {
            throwMBeanException(e.getCause());
        }
View Full Code Here

    public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException {
      String property = name.toString();
      RequestContext requestContext = (RequestContext) target;
      if (property.equals("flowRequestContext")) {
        throw new OgnlException("The 'flowRequestContext' variable is not writeable");
      }
      if (property.equals("currentUser")) {
        throw new OgnlException("The 'currentUser' variable is not writeable");
      }
      if (property.equals("resourceBundle")) {
        throw new OgnlException("The 'resourceBundle' variable is not writeable");
      }
      if (requestContext.getRequestScope().contains(property)) {
        requestContext.getRequestScope().put(property, value);
      } else if (requestContext.getFlashScope().contains(property)) {
        requestContext.getFlashScope().put(property, value);
View Full Code Here

      annotated.setMethod(name.toString());
      return annotated;
    }

    public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException {
      throw new OgnlException("Cannot set properties on a Action instance - operation not allowed");
    }
View Full Code Here

        return messageSource.getMessage(name.toString(), null, null, null);
      }
    }

    public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException {
      throw new OgnlException("Cannot set properties on a MessageSource instance - operation not allowed");
    }
View Full Code Here

            if (result instanceof Boolean) {
                if (((Boolean) result).booleanValue()) {
                    answer.add(s);
                }
            } else {
                throw new OgnlException(
                        "Query didn't return a boolean value: " + query);
            }
        }
       
        return answer;
View Full Code Here

TOP

Related Classes of ognl.OgnlException

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.