environmentContext.pushEnvironmentInteraction(envTracker);
// See if an expression context already exists or not; an expression
// context is shared throughout the lifetime of the request but is
// lazily instantiated
ExpressionContext expressionContext =
MCSExpressionHelper.getExpressionContext(context);
if (expressionContext == null) {
// create the expression context, register the functions that are
// needed and store this expression context away in the page
// context
expressionContext =
factory.createExpressionContext(
envTracker,
NamespaceFactory.getDefaultInstance().
createPrefixTracker());
registerFunctions(expressionContext);
// Store the ExpressionContext in the EnvironmentContext. This
// allows the expression context to be shared across all
// sub-requests of a request.
// The expression context needs to set this property so that expressions
// work when rendered at runtime.
expressionContext.setProperty(MarinerRequestContext.class,
context,
false);
// Allow XPath expressions access to the device
registerDevicePolicyValueAccessor(expressionContext, devicePolicyValueAccessor);