Interface OgnlGuard

All Known Implementing Classes:
StrutsOgnlGuard

public interface OgnlGuard
Guards all expressions parsed by Struts Core. It is evaluated by OgnlUtil immediately after parsing any expression.
Since:
6.4.0
  • Field Details

  • Method Details

    • isBlocked

      default boolean isBlocked(String expr) throws ognl.OgnlException
      Determines whether an OGNL expression should be blocked based on validation done on both the raw expression and the parsed tree.
      Parameters:
      expr - OGNL expression
      Returns:
      whether the expression should be blocked
      Throws:
      ognl.OgnlException
    • parseExpression

      default Object parseExpression(String expr) throws ognl.OgnlException
      Parses an OGNL expression and returns the resulting tree only if the expression is not blocked as per defined validation rules in isRawExpressionBlocked(java.lang.String) and isParsedTreeBlocked(java.lang.Object).
      Parameters:
      expr - OGNL expression
      Returns:
      parsed expression or EXPR_BLOCKED if the expression should be blocked
      Throws:
      ognl.OgnlException
    • isRawExpressionBlocked

      boolean isRawExpressionBlocked(String expr)
      Determines whether an OGNL expression should be blocked based on validation done on only the raw expression, without parsing the tree.
      Parameters:
      expr - OGNL expression
      Returns:
      whether the expression should be blocked
    • isParsedTreeBlocked

      boolean isParsedTreeBlocked(Object tree)
      Determines whether a parsed OGNL tree should be blocked based on some validation rules.
      Parameters:
      tree - parsed OGNL tree
      Returns:
      whether the parsed tree should be blocked