final String expr =
((accessExpression != null && accessExpression.startsWith("${") && accessExpression.endsWith("}"))?
accessExpression.substring(2, accessExpression.length() - 1) :
accessExpression);
final WebSecurityExpressionHandler handler = getExpressionHandler(servletContext);
Expression expressionObject = null;
try {
expressionObject = handler.getExpressionParser().parseExpression(expr);
} catch (ParseException e) {
throw new TemplateProcessingException(
"An error happened trying to parse Spring Security access expression \"" +
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