Package org.apache.struts2.ognl
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 SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptiondefault booleanDetermines whether an OGNL expression should be blocked based on validation done on both the raw expression and the parsed tree.booleanisParsedTreeBlocked(Object tree) Determines whether a parsed OGNL tree should be blocked based on some validation rules.booleanisRawExpressionBlocked(String expr) Determines whether an OGNL expression should be blocked based on validation done on only the raw expression, without parsing the tree.default ObjectparseExpression(String expr) Parses an OGNL expression and returns the resulting tree only if the expression is not blocked as per defined validation rules inisRawExpressionBlocked(java.lang.String)andisParsedTreeBlocked(java.lang.Object).
- 
Field Details- 
EXPR_BLOCKED- See Also:
 
 
- 
- 
Method Details- 
isBlockedDetermines 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
 
- 
parseExpressionParses an OGNL expression and returns the resulting tree only if the expression is not blocked as per defined validation rules inisRawExpressionBlocked(java.lang.String)andisParsedTreeBlocked(java.lang.Object).- Parameters:
- expr- OGNL expression
- Returns:
- parsed expression or EXPR_BLOCKEDif the expression should be blocked
- Throws:
- ognl.OgnlException
 
- 
isRawExpressionBlockedDetermines 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
 
- 
isParsedTreeBlockedDetermines 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
 
 
-