expr + "\"", e);
}
final FilterInvocation filterInvocation = new FilterInvocation(request, response, DUMMY_CHAIN);
final EvaluationContext evaluationContext = handler.createEvaluationContext(authentication, filterInvocation);
/*
* Initialize the context variables map.
*
* This will allow SpringSecurity expressions to include any variables from
* the IContext just by accessing them as properties of the "#vars" utility object.
*/
Map<String,Object> contextVariables = null;
if (processingContext instanceof Arguments) {
// Try to initialize the context variables by asking the SpEL expression
// evaluator object (which might be a subclass of the standard one) to create
// this variable map.
final Arguments arguments = (Arguments) processingContext;
final IStandardVariableExpressionEvaluator expressionEvaluator =
StandardExpressions.getVariableExpressionEvaluator(arguments.getConfiguration());
contextVariables =
SpringVersionSpecificUtils.computeExpressionObjectsFromExpressionEvaluator(arguments, expressionEvaluator);
}
if (contextVariables == null) {
// if we could not create it the more integrated way, just do it the hard-wired way
contextVariables = new HashMap<String, Object>();
final Map<String,Object> expressionObjects = processingContext.getExpressionObjects();
if (expressionObjects != null) {
contextVariables.putAll(expressionObjects);
}
}
// We add Thymeleaf's wrapper on top of the SpringSecurity basic evaluation context
final EvaluationContext wrappedEvaluationContext =
SpringVersionSpecificUtils.wrapEvaluationContext(evaluationContext, contextVariables);
if (ExpressionUtils.evaluateAsBoolean(expressionObject, wrappedEvaluationContext)) {